From 2c26c8485933e1e720d86a6df6a7e7ab4b56718c Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 18 Jan 2024 12:50:16 +0530 Subject: [PATCH 1/2] Release 18012024 QSM 8.2.2 --- js/qsm-quiz.js | 13 +++++++++---- mlw_quizmaster2.php | 4 ++-- php/admin/options-page-text-tab.php | 10 ++-------- php/admin/settings-page.php | 5 +---- php/classes/class-qsm-fields.php | 10 ++++------ php/question-types/qsm-question-title.php | 11 +++++++++-- php/template-variables.php | 5 ++--- readme.txt | 9 ++++++++- 8 files changed, 37 insertions(+), 30 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index f5d69ec40..3b9a934e5 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -755,7 +755,7 @@ function qmnValidation(element, quiz_form_id) { 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 (localStorage.getItem('mlw_time_quiz' + quiz_id) === null || (0 == localStorage.getItem('mlw_time_quiz' + quiz_id) && by_pass == false) || 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); show_result_validation = false; @@ -1331,9 +1331,9 @@ function qmnInitPagination(quiz_id) { jQuery(document).trigger('qsm_init_pagination_after', [quiz_id, qmn_quiz_data]); } jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after', function(event, quiz_id) { - let video_sections = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('video'); - let iframeVideos = jQuery(`.qsm-quiz-container-${quiz_id}.qmn_quiz_container`).find('iframe'); - + let video_sections = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container').find('video'); + let iframeVideos = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container .qsm-page, .qsm-quiz-container-' + quiz_id + '.qmn_quiz_container .qsm-auto-page-row').find('iframe'); + let audio_sections = jQuery('.qsm-quiz-container-' + quiz_id + '.qmn_quiz_container').find('audio'); iframeVideos.each(function() { let src = this.src; jQuery(this).attr('src', src); @@ -1343,6 +1343,11 @@ jQuery(document).on('qsm_next_button_click_after qsm_previous_button_click_after this.pause(); } }); + audio_sections.each(function() { + if (!this.paused) { + this.pause(); + } + }); }); function qmnSocialShare(network, mlw_qmn_social_text, mlw_qmn_title, facebook_id, share_url) { var sTop = window.screen.height / 2 - (218); diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index b4130e1b5..628392474 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -2,7 +2,7 @@ /** * Plugin Name: Quiz And Survey Master * Description: Easily and quickly add quizzes and surveys to your website. - * Version: 8.2.1 + * Version: 8.2.2 * Author: ExpressTech * Author URI: https://quizandsurveymaster.com/ * Plugin URI: https://expresstech.io/ @@ -43,7 +43,7 @@ class MLWQuizMasterNext { * @var string * @since 4.0.0 */ - public $version = '8.2.1'; + public $version = '8.2.2'; /** * QSM Alert Manager Object diff --git a/php/admin/options-page-text-tab.php b/php/admin/options-page-text-tab.php index 438cc7bb2..86ab33027 100644 --- a/php/admin/options-page-text-tab.php +++ b/php/admin/options-page-text-tab.php @@ -96,10 +96,7 @@ function mlw_options_text_tab_content() { wp_editor( htmlspecialchars_decode( $value_answer, ENT_QUOTES ), 'qsm_question_text_message', array( 'editor_height' => 250, 'textarea_rows' => 10, - 'tinymce' => array( - 'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv', - 'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help', - ), + 'tinymce' => true, ) ); ?> @@ -152,10 +149,7 @@ function mlw_options_text_tab_content() { wp_editor( htmlspecialchars_decode( $value_answer, ENT_QUOTES ), 'qsm_question_text_message_variable', array( 'editor_height' => 250, 'textarea_rows' => 10, - 'tinymce' => array( - 'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv', - 'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help', - ), + 'tinymce' => true, ) ); ?> diff --git a/php/admin/settings-page.php b/php/admin/settings-page.php index 3cd1e4058..0c9a05609 100644 --- a/php/admin/settings-page.php +++ b/php/admin/settings-page.php @@ -484,10 +484,7 @@ public function results_details_template() { } wp_editor( $template, 'results_template', array( 'textarea_name' => 'qmn-settings[results_details_template]', - 'tinymce' => array( - 'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv', - 'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help', - ), + 'tinymce' => true, ) ); } diff --git a/php/classes/class-qsm-fields.php b/php/classes/class-qsm-fields.php index 8ec0a5b4a..3564ac1f1 100644 --- a/php/classes/class-qsm-fields.php +++ b/php/classes/class-qsm-fields.php @@ -597,12 +597,10 @@ public static function generate_editor_field( $field, $value ) { - array( - 'toolbar1' => 'formatselect,bold,italic,underline,bullist,numlist,blockquote,alignleft,aligncenter,alignright,alignjustify,link,wp_more,fullscreen,wp_adv', - 'toolbar2' => 'strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help', - ), -) ); ?> + true, + ) ); ?> deselect_answer_text ) ? $qmn_quiz_options->deselect_answer_text : $default_texts['deselect_answer_text']; $deselect_answer = ''. $mlwQuizMasterNext->pluginHelper->qsm_language_support( $deselect_answer_text, "deselect_answer_text-{$qmn_quiz_options->quiz_id}" ) .''; } - do_action('qsm_question_title_func_before',$question, $question_type, $new_question_title, $question_id ); + do_action('qsm_question_title_function_before',$question, $question_type, $new_question_title, $question_id ); if ( '' !== $new_question_title ) { $new_question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $new_question_title, ENT_QUOTES ), "Question-{$question_id}", "QSM Questions"); + $new_question_title = apply_filters( 'qsm_question_title_before', $new_question_title, $question_type, $question_id ); ?>
(.*?)<\/code>/s'; + $question_description = preg_replace_callback($pattern, function ( $matches ) { + return preg_replace([ '/<(?!(\/?code|br)[ >])/', '/>(?!(\/?code|br)[ \/>])/' ], [ '<', '>' ], $matches[0]); + }, $question_title); + $question_description = str_replace([ 'code>', 'br />' ],[ 'code/>', 'br />' ], $question_description ); + $question_description = apply_filters( 'qsm_question_description_before', $question_description, $question_type, $question_id ); ?> -

+

pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ); + $decode_single_user_answer = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ); } else { $decode_show_user_answer = htmlspecialchars_decode( mb_strtoupper( $show_user_answer ), ENT_QUOTES ); - $decode_single_user_answer = mb_strtoupper( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ) ); + $decode_single_user_answer = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $single_answer[0], 'QSM Answers' ), ENT_QUOTES ) ); } if ( $decode_show_user_answer == $decode_single_user_answer ) { diff --git a/readme.txt b/readme.txt index fe5a6eae8..8500c2b12 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q Requires at least: 4.9 Tested up to: 6.4 Requires PHP: 5.4 -Stable tag: 8.2.1 +Stable tag: 8.2.2 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -163,6 +163,13 @@ This is usually a theme conflict. You can [checkout out our common conflict solu 18. Database == Changelog == += 8.2.2 (January 18, 2024) = +* Feature: Added an option to mark texts as code snippets in the question description +* Bug: Fixed the issue of skipping question validation after the quiz timer ends +* Bug: Fixed issue when using apostrophe in fill-in-the-blanks questions +* Bug: Fixed the quiz navigation problem with reCAPTCHA +* Enhancement: Improved auto-pause logic for embedded audio when shifting pages. + = 8.2.1 (January 05, 2024) = * Feature: Added option to delete bulk questions * Bug: Resolved JavaScript conflicts From 9bd1bf91ee85e5b5a5c405aabaf2710bce7aa028 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 18 Jan 2024 14:50:26 +0530 Subject: [PATCH 2/2] fixed php warnings with 8.0 --- php/classes/question-types/class-question-review.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/classes/question-types/class-question-review.php b/php/classes/question-types/class-question-review.php index 3f2df85f9..4ee6933a8 100644 --- a/php/classes/question-types/class-question-review.php +++ b/php/classes/question-types/class-question-review.php @@ -11,6 +11,7 @@ abstract class QSM_Question_Review { public $answer_status = 'incorrect'; public $points = 0; public $question_description = ''; + public $question_type = 0; public $input_field = ''; public $form_type = 0; public $grading_system = 0;