Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cu 86795gc2y accessibility issues #2429

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed recaptcha varfication issue
zubairraeen committed Dec 27, 2023
commit 4ca539d7efafe8ddae0914a6c281425b9856b726
8 changes: 5 additions & 3 deletions js/qsm-quiz.js
Original file line number Diff line number Diff line change
@@ -755,7 +755,7 @@ function qmnValidation(element, quiz_form_id) {
by_pass = false;
}

if (localStorage.getItem('mlw_time_quiz' + quiz_id) === null || localStorage.getItem('mlw_time_quiz' + quiz_id) > 0.08 || by_pass === false) {
if (localStorage.getItem('mlw_time_quiz' + quiz_id) === null || 0 === localStorage.getItem('mlw_time_quiz' + quiz_id) || localStorage.getItem('mlw_time_quiz' + quiz_id) > 0.08 || by_pass === false) {

if (jQuery(this).attr('class').indexOf('mlwRequiredNumber') > -1 && this.value === "" && +this.value != NaN) {
qmnDisplayError(error_messages.number_error_text, jQuery(this), quiz_form_id);
@@ -806,8 +806,10 @@ function qmnValidation(element, quiz_form_id) {
}
//Google recaptcha validation
if (jQuery(this).attr('class').indexOf('g-recaptcha-response') > -1) {
if (grecaptcha.getResponse() == "") {
alert('ReCaptcha is missing');
let recaptcha_id = jQuery(this).attr('id');
let recaptcha_index = recaptcha_id.replace("g-recaptcha-response-", "");
if (grecaptcha.getResponse(recaptcha_index) == "") {
alert(error_messages.recaptcha_error_text);
show_result_validation = false;
}
}
1 change: 1 addition & 0 deletions php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
@@ -904,6 +904,7 @@ public function display_quiz( $options, $quiz_data, $question_amount, $shortcode
'url_error_text' => $mlwQuizMasterNext->pluginHelper->qsm_language_support( $options->url_error_text, "quiz_url_error_text-{$options->quiz_id}" ),
'minlength_error_text' => $mlwQuizMasterNext->pluginHelper->qsm_language_support( $options->minlength_error_text, "quiz_minlength_error_text-{$options->quiz_id}" ),
'maxlength_error_text' => $mlwQuizMasterNext->pluginHelper->qsm_language_support( $options->maxlength_error_text, "quiz_maxlength_error_text-{$options->quiz_id}" ),
'recaptcha_error_text' => __( 'ReCaptcha is missing', 'quiz-master-next' ),
);
$qmn_json_data = apply_filters( 'qsm_json_error_message', $qmn_json_data ,$options);
wp_enqueue_script( 'progress-bar', QSM_PLUGIN_JS_URL . '/progressbar.min.js', array(), '1.1.0', true );