From b0291bb4cd6b229936dfd3412aa9b0c1ed02cfd6 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Wed, 9 Oct 2024 17:48:36 +0530 Subject: [PATCH 01/11] update readme file --- readme.txt | 58 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/readme.txt b/readme.txt index 93fc2ba8..e562030b 100644 --- a/readme.txt +++ b/readme.txt @@ -12,7 +12,7 @@ Create engaging quizzes, surveys, tests, & more, with the versatile quiz maker a == Description == -**Quiz and Survey Master** is the easiest quiz and survey maker plugin for creating quizzes, surveys, and forms on your WordPress website. Create everything from fun trivia quizzes to in-depth customer satisfaction assessments, using a user-friendly drag-and-drop quiz maker interface. Go beyond basic questions with multimedia support for richer content, analyze results to gain valuable insights, and even integrate with email marketing services to capture leads. Quiz & Survey Master is a powerful WordPress plugin to increase user engagement, gather valuable data, and build a stronger connection with your audience. +**Quiz and Survey Master** is the easiest quiz and survey maker plugin for creating quizzes, surveys, and forms on your WordPress website. Create everything from fun trivia quizzes to in-depth customer satisfaction assessments, using a user-friendly **drag-and-drop quiz maker** interface. Go beyond basic questions with multimedia support for richer content, analyze results to gain valuable insights, and even integrate with email marketing services to capture leads. Quiz & Survey Master is a **powerful WordPress plugin** to increase user engagement, gather valuable data, and build a stronger connection with your audience. **Try Demo ➡️ [Get a personal sandbox demo with QSM](https://instawp.io/plugins/quiz-master-next?utm_source=wp.org&utm_medium=wp_org_description&utm_campaign=wp_org_to_qsm)** @@ -20,9 +20,9 @@ https://youtu.be/DyiCCNnDpHk?si=7nda3koRTGw7BW_J ### CREATE UNLIMITED QUIZZES AND QUESTIONS -Create without limits with our online quiz maker— QSM—to craft unlimited quizzes with endless questions in diverse formats. Utilize the built-in text editor to format text and incorporate images, audio, and video. Build forms, quizzes, and surveys that resonate with your audience, creating a fulfilling learning and engagement experience. +Create without limits with our [online quiz maker](https://quizandsurveymaster.com/)— QSM—to craft unlimited quizzes with endless questions in diverse formats. Utilize the built-in text editor to format text and incorporate images, audio, and video. Build forms, quizzes, and surveys that resonate with your audience, creating a fulfilling learning and engagement experience. -This WordPress quiz maker allows you to create from lead generation quizzes, and customer satisfaction surveys, to assessments, personality tests, fun trivia quizzes, and more. +This [WordPress quiz maker](https://quizandsurveymaster.com/free-quiz-maker-wordpress-plugins/) allows you to create from lead generation quizzes, and customer satisfaction surveys, to assessments, personality tests, fun trivia quizzes, and more. ### QUIZ DEMOS @@ -51,7 +51,7 @@ Create quizzes, forms, or surveys with a variety of question types tailored to y - **Opt-in**: Use the checkbox selection to give permission/agree to a text. -Engage your audience effortlessly with our interactive quiz builder! Easily create tailored quizzes, forms, or surveys using diverse question types that align with your goals and make interaction fun. +Engage your audience effortlessly with our **interactive quiz builder**! Easily create tailored quizzes, forms, or surveys using diverse question types that align with your goals and make interaction fun. - **Multiple Choice**: Choose one correct answer option. - **Multiple Response**: Select multiple correct answer options. @@ -75,15 +75,15 @@ QSM comes with some advanced question types in their pro plan; ### CREATE QUIZ WITH BLOCK EDITOR -Block Editors in WordPress simplify content creation and customization through intuitive drag-and-drop functionality. QSM incorporates its own block editor, making it the easiest and most convenient way to create quizzes in WordPress, enhancing user experience and workflow efficiency. +Block Editors in WordPress simplify content creation and customization through intuitive drag-and-drop functionality. QSM incorporates its own block editor, making it the easiest and most convenient way to [create quizzes in WordPress](https://quizandsurveymaster.com/create-quiz-using-quiz-builder-plugin-in-wordpress/), enhancing user experience and workflow efficiency. ### GAIN BUSINESS INSIGHTS WITH SURVEYS -With the QSM plugin, effortlessly create detailed market research surveys and share them on social platforms to gather valuable consumer information. Store the data in a database or export it for analysis using QSM's advanced features like the export add-on and reporting and analysis add-on. Gain valuable insights from efficient data collection and analysis, enabling you to make informed business decisions and share the findings with your audience. +With the QSM plugin, effortlessly create detailed [market research surveys](https://quizandsurveymaster.com/create-market-research-surveys/) and share them on social platforms to gather valuable consumer information. As a comprehensive **survey plugin for WordPress**, QSM allows you to store data in a database or export it for analysis using advanced features like the export add-on and reporting and analysis addon. Gain valuable insights from efficient data collection and analysis, enabling you to make informed business decisions and share the findings with your audience. ### FULLY CUSTOMIZABLE -Create custom quiz and survey forms by customizing every aspect of your quizzes and surveys that users interact with, using our WordPress quiz builder’s flexible features; +Create **custom quiz and survey forms** by customizing every aspect of your quizzes and surveys that users interact with, using our **WordPress quiz builder’s** flexible features; **Custom Style CSS**: Personalize the look and feel of your quizzes and surveys to match your brand and style perfectly. @@ -95,11 +95,11 @@ Create custom quiz and survey forms by customizing every aspect of your quizzes ### RESPONSIVE DESIGN -Quiz and Survey Master ensures that your WordPress forms, quizzes, and surveys look and perform flawlessly on any device and browser, thanks to its responsive quiz design. This WordPress quiz maker offers smooth performance, even when using its various themes. You can also create unlimited questions without lag and easily share your quizzes with an audience. +Quiz and Survey Master ensures that your WordPress forms, quizzes, and surveys look and perform flawlessly on any device and browser, thanks to its **responsive quiz design**. This WordPress quiz maker offers smooth performance, even when using its various themes. You can also create unlimited questions without lag and easily share your quizzes with an audience. ### DISPLAY SCORE-BASED CUSTOM RESULTS -With the QSM plugin, you can create customized results based on quiz scores. Tailor multiple result pages to different score ranges, offering a unique and engaging experience for each participant. +With the QSM plugin, you can [create customized results](https://quizandsurveymaster.com/docs/v8/setting-up-results-pages/) based on quiz scores. Tailor multiple result pages to different score ranges, offering a unique and engaging experience for each participant. For example, based on a high score, display a result with a congratulatory message and additional resources, providing high-achieving participants with further learning opportunities. While for a lower score, you might display a result with encouragement and tips for improvement to help users progress. @@ -117,23 +117,23 @@ Organize your questions by assigning parent and sub-categories. Create category- ### GENERATE LEADS WITH BUILT-IN CONTACT FORM -Expand your customer base and nurture leads effectively with QSM’s in-built contact forms. Easily collect emails and smoothly integrate with top marketing tools like Mailchimp, ActiveCampaign, Zapier, Campaign Monitor, and GetResponse to drive targeted marketing campaigns. +Expand your customer base and nurture leads effectively with QSM’s **lead capture quizzes** with in-built contact forms. Collect emails easily and smoothly integrate with top marketing tools like Mailchimp, ActiveCampaign, Zapier, Campaign Monitor, and GetResponse to drive targeted marketing campaigns. ### OTHER USEFUL FEATURES -- Set countdown timer -- Schedule active date and timeframe for quizzes/surveys -- Set Multi-Page surveys and quizzes with a limited number of questions per page -- Enable social sharing of quiz/survey results -- Require user login for privacy and access restrictions -- Personalized quiz experience with randomized questions, answers, or both -- Import questions from the Question Bank across quizzes and surveys. -- Set a limit for incorrect answers that automatically ends the quiz. -- Limit the number of total entries to quiz or survey -- Set the number of user attempts to complete the form -- Display the welcome quiz page with animation -- Enable comment boxes for each question -- Enable hints for questions to assist participants. -- Create math formulas in questions, using TeX and LaTeX notation. +- Set **countdown timer** +- **Schedule active date and timeframe** for quizzes/surveys +- **Set Multi-Page** surveys and quizzes with a limited number of questions per page +- **Enable social sharing** of quiz/survey results +- **Require user login** for privacy and access restrictions +- Personalized quiz experience with **randomized questions, answers, or both** +- Import questions from the **Question Bank** across quizzes and surveys. +- Set a **limit for incorrect answers** that automatically ends the quiz. +- Limit the **number of total entries** to quiz or survey +- **Set the number of user attempts** to complete the form +- Display the welcome **quiz page with animation** +- **Enable comment boxes** for each question +- **Enable hints** for questions to assist participants. +- **Create math formulas** in questions, using TeX and LaTeX notation. - Compatible with [WPML](https://wpml.org/?utm_source=wp.org&utm_medium=wp_org_description&utm_campaign=wp_org_to_qsm) and its extensions - And Much More… @@ -188,25 +188,25 @@ This section describes how to install the plugin and get it working. = How do I get started with QSM - A free quiz maker in WordPress? = -The quickest way to build a quiz is using the QSM - Block Editor in WordPress. Simply navigate to a New Page or Post, select the QSM Block, and add a new quiz. Enter the quiz's name, set advanced options if required, and click Create Quiz. From there, start adding questions and options, choosing question types from the right-side panel, and Save your draft. Once ready, click Publish to post the quiz on the WordPress website. +The quickest way to build a quiz is using the **QSM - Block Editor** in WordPress. Simply navigate to a New Page or Post, select the QSM Block, and add a new quiz. Enter the quiz's name, set advanced options if required, and click **Create Quiz**. From there, start adding questions and options, choosing question types from the right-side panel, and Save your draft. Once ready, click Publish to post the quiz on the WordPress website. Alternatively, you can create a quiz or survey using the default method, which offers more features and settings. If you have started a quiz in the block editor, simply save the draft and go to QSM > Quizzes/Surveys to edit your existing quiz or add a new one to continue building it with full customization options. = Can this plugin be translated? = -Yes, it’s completely possible! With integration to the WPML plugin, this online quiz tool enables you to translate your quizzes and surveys into multiple languages. For more information, refer to the documentation on translating the QSM WordPress plugin. +Yes, it’s completely possible! With integration to the WPML plugin, this **online quiz tool** enables you to translate your quizzes and surveys into multiple languages. For more information, refer to the documentation on [translating the QSM WordPress plugin](https://quizandsurveymaster.com/docs/advanced-topics/qsm-wpml/#Translating_QSM_Defaults). = How can I get access to all advanced features? = -To access advanced features, integrations, and themes, you can upgrade to the QSM All Access plan. The pro license gives you access to our 40 add-ons such as advanced assessment, flashcards, email integrations, advanced analytics, and 8 premium themes +To access advanced features, integrations, and themes, you can upgrade to the [QSM All Access plan](https://quizandsurveymaster.com/pricing/). The pro license gives you access to our 40 add-ons such as advanced assessment, flashcards, email integrations, advanced analytics, and 8 premium themes = Can I create paid quizzes and surveys? = -Yes, this is achievable by our Payment Integration add-on. Using PayPal and Stripe, you can easily add payments to your online quizzes and surveys, allowing you to monetize your content easily. +Yes, this is achievable by our [Payment Integration add-on](https://quizandsurveymaster.com/downloads/paypal-and-stripe-payment-integration/). Using **PayPal** and **Stripe**, you can easily add payments to your online quizzes and surveys, allowing you to monetize your content easily. = Can I display different content based on user responses? = -Absolutely! With QSM, you can create conditional logic-based quizzes and surveys, where specific questions or content are displayed based on the user's previous responses. This feature is particularly useful for creating personalized experiences, such as personality quizzes or branching surveys. +Absolutely! With QSM, you can create conditional logic-based **quizzes** and surveys, where specific questions or content are displayed based on the user's previous responses. This feature is particularly useful for creating personalized experiences, such as personality quizzes or branching surveys. = Can I collect and analyze user data from my quizzes and surveys? = From 382e135d8cd8a471786a22cd07e50db9bf2ba5c5 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 15 Oct 2024 12:41:12 +0530 Subject: [PATCH 02/11] Fixed correct answer not showing with random match type in Fill in the blank question --- php/template-variables.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/php/template-variables.php b/php/template-variables.php index 564fe870..a0cfdead 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -1200,8 +1200,9 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question } else { $options[] = mb_strtoupper( htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ) ); } + $question_correct_fill_answer_text .= '(' . $key + 1 . ') ' . strval( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ) ) . ''; } - + $is_any_incorrect = false; if ( sizeof( $new_array_user_answer ) < sizeof( $total_answers ) ) { foreach ( $new_array_user_answer as $show_user_answer ) { if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) { @@ -1212,6 +1213,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question if ( false !== $key ) { $question_with_answer_text .= '' . htmlspecialchars_decode( $show_user_answer, ENT_QUOTES ) . ''; } else { + $is_any_incorrect = true; if ( '' === $show_user_answer ) { $show_user_answer = $quiz_options->no_answer_text; } @@ -1229,7 +1231,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question if ( false !== $key ) { $question_with_answer_text .= '' . $show_user_answer . ''; } else { - + $is_any_incorrect = true; if ( '' === $show_user_answer ) { $show_user_answer = $quiz_options->no_answer_text; } @@ -1237,6 +1239,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question } } } + $question_with_answer_text = $is_any_incorrect ? $question_with_answer_text . $question_correct_fill_answer_text : $question_with_answer_text; } } else { if ( 0 == $form_type && ( 0 == $quiz_system || 3 == $quiz_system ) ) { From b249ae9cdf35116ea2c02bf4a7d33612a6e3521c Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Tue, 15 Oct 2024 12:47:31 +0530 Subject: [PATCH 03/11] Fixed sonar issue --- php/template-variables.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/template-variables.php b/php/template-variables.php index a0cfdead..5a561122 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -1194,6 +1194,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question } } else { $options = array(); + $question_correct_fill_answer_text = ''; foreach ( $total_answers as $key => $single_answer ) { if ( isset($answer['case_sensitive']) && 1 === intval( $answer['case_sensitive'] ) ) { $options[] = htmlspecialchars_decode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $single_answer[0], 'answer-' . $answer['id'] . '-' . $key, 'QSM Answers' ), ENT_QUOTES ); From 553cb974a3afe872a66be3f8af2a887ec62e6c18 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Tue, 15 Oct 2024 13:25:22 +0530 Subject: [PATCH 04/11] fixed Vulnerability report --- css/qsm-admin.css | 1 + php/classes/class-qsm-fields.php | 3 +++ php/shortcodes.php | 11 +++++------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/css/qsm-admin.css b/css/qsm-admin.css index f15f72b6..6dc4748b 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -1378,6 +1378,7 @@ tr .qsm-opt-desc { #quiz_settings_wrapper .qsm-opt-desc { display: none !important; } +.qsm_page_qmn_global_settings .form-table td fieldset label, .qsm_tab_content .form-table td fieldset label { margin-right: 20px !important; width: 100%; diff --git a/php/classes/class-qsm-fields.php b/php/classes/class-qsm-fields.php index bd6b9a05..bc81b4c3 100644 --- a/php/classes/class-qsm-fields.php +++ b/php/classes/class-qsm-fields.php @@ -77,6 +77,9 @@ public static function generate_section( $fields, $section ) { case 'number': $sanitized_value = isset( $_POST[ $key ] ) ? intval( $_POST[ $key ] ) : ""; break; + case 'image': + $sanitized_value = isset( $_POST[ $key ] ) ? esc_url_raw( wp_unslash( $_POST[ $key ] ) ) : ""; + break; default: $sanitized_value = isset( $_POST[ $key ] ) ? sanitize_text_field( wp_unslash( $_POST[ $key ] ) ) : ""; break; diff --git a/php/shortcodes.php b/php/shortcodes.php index ef7e5a2a..45dad941 100644 --- a/php/shortcodes.php +++ b/php/shortcodes.php @@ -183,12 +183,11 @@ function qsm_generate_fb_header_metadata() { $sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'facebook_sharing_text', '' ); $sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $results_array ); $default_fb_image = QSM_PLUGIN_URL . 'assets/icon-200x200.png'; - $get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' ); - if ( empty( $get_fb_sharing_image ) ) { - $get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' ); - } - if ( '' !== $get_fb_sharing_image && filter_var( $get_fb_sharing_image, FILTER_VALIDATE_URL ) ) { - $default_fb_image = $get_fb_sharing_image; + $fb_sharing_image_quiz_options = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' ); + $fb_sharing_image_quiz_text = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' ); + $get_fb_sharing_image = ! empty($fb_sharing_image_quiz_options) ? $fb_sharing_image_quiz_options : $fb_sharing_image_quiz_text; + if ( ! empty($get_fb_sharing_image) && filter_var($get_fb_sharing_image, FILTER_VALIDATE_URL) ) { + $default_fb_image = esc_url($get_fb_sharing_image); } $post = $wp_query->get_queried_object(); $pagename = $post->post_title; From 34d3b5d343f212957b75f94644ee6e6c6a14663a Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Tue, 15 Oct 2024 17:03:54 +0530 Subject: [PATCH 05/11] fixed fatal error with user role --- mlw_quizmaster2.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index ce63fc21..d3ed9218 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -756,11 +756,15 @@ public function qsm_add_user_capabilities() { ); $user = wp_get_current_user(); + if ( empty( $user->roles ) || ! is_array( $user->roles ) ) { + return; + } $roles = (array) $user->roles; $rolename = $roles[0]; - $role = get_role( $rolename ); - + if ( ! $role ) { + return; + } // Remove all capabilities first. foreach ( $administrator_capabilities as $cap ) { if ( $role->has_cap( $cap ) ) { From 81c2212e7a424af4a25f20a8bb49fb72fb306e52 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Wed, 16 Oct 2024 15:32:37 +0530 Subject: [PATCH 06/11] update changelog 9.2.1 --- mlw_quizmaster2.php | 4 ++-- readme.txt | 25 +++++++------------------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index d3ed9218..2a6e8e6b 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: 9.2.0 + * Version: 9.2.1 * 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 = '9.2.0'; + public $version = '9.2.1'; /** * QSM Alert Manager Object diff --git a/readme.txt b/readme.txt index e562030b..94243444 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: quiz, survey, test, exam, online assessment Requires at least: 4.9 Tested up to: 6.6 Requires PHP: 5.4 -Stable tag: 9.2.0 +Stable tag: 9.2.1 License: GPLv2 License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -35,22 +35,6 @@ This [WordPress quiz maker](https://quizandsurveymaster.com/free-quiz-maker-word ### DIVERSE RANGE OF QUESTIONS -Create quizzes, forms, or surveys with a variety of question types tailored to your specific goals: - -- **Multiple Choice**: Choose one correct answer option. -- **Multiple Response**: Select multiple correct answer options. -- **Dropdown**: Pick one correct answer from the dropdown menu options. -- **Short Answer**: Provide concise written responses. -- **Paragraph**: Write longer, detailed answers. -- **Fill in the Blank**: Complete sentences with the correct missing words. -- **Date**: Select a specific calendar date. -- **File Upload**: Attach images, PDFs, and documents. -- **Number**: Enter answers in numerical format. -- **Captcha**: Verify identity with anti-bot check. -- **Polar**: Answer by choosing a spot on the slider scale. -- **Opt-in**: Use the checkbox selection to give permission/agree to a text. - - Engage your audience effortlessly with our **interactive quiz builder**! Easily create tailored quizzes, forms, or surveys using diverse question types that align with your goals and make interaction fun. - **Multiple Choice**: Choose one correct answer option. @@ -66,7 +50,7 @@ Engage your audience effortlessly with our **interactive quiz builder**! Easily - **Polar**: Answer by choosing a spot on the slider scale. - **Opt-in**: Use the checkbox selection to give permission/agree to a text. -ADVANCED QUESTION TYPES +**ADVANCED QUESTION TYPES** QSM comes with some advanced question types in their pro plan; - **Matching Pairs** - Drag and drop answers vertically to match with the correct option. @@ -238,6 +222,11 @@ As a WordPress quiz maker, QSM is designed to be compatible with most other plug 18. Database == Changelog == += 9.2.1 ( October 16, 2024 ) = +* Bug: Resolved vulnerability issue with question settings +* Bug: Fixed issue with fill in the blanks question type while using random answers +* Bug: Fixed php warning with user permission function + = 9.2.0 ( October 07, 2024 ) = * Bug: Resolved HTML tag issue with the %USER_ANSWER% variable * Bug: Fixed the issue with contact form position settings From 312072a34de4a8b63c42361e00f4b3a8a7d4d7e3 Mon Sep 17 00:00:00 2001 From: manandeep singh Date: Thu, 17 Oct 2024 13:06:15 +0530 Subject: [PATCH 07/11] Fix legacy timer count up --- js/qsm-quiz.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index bbd87c64..125b4e41 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -170,9 +170,12 @@ var qsmTimerInterval = []; } var secondsRemaining = qmn_quiz_data[quizID].timerRemaning; var secondsConsumed = qmn_quiz_data[quizID].timerConsumed; - jQuery(document).trigger('qmn_timer_consumed_seconds', [quizID, qmn_quiz_data, qsm_timer_consumed_obj]); if (localStorage.getItem('mlw_time_quiz' + quizID) != null ) { secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed + 1; + if(qsm_timer_consumed_obj.qmn_count_upward_status){ + secondsConsumed = qmn_quiz_data[quizID].timerConsumed - 1; + secondsRemaining = (parseFloat(qmn_quiz_data[quizID].timer_limit) * 60) - secondsConsumed; + } if(secondsRemaining < 0) { secondsRemaining = 0; } From 311d2e156fcbacbafceb6ee056661ead67663f76 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Fri, 18 Oct 2024 11:49:53 +0530 Subject: [PATCH 08/11] added index to response_data --- php/classes/class-qsm-results-pages.php | 1 + 1 file changed, 1 insertion(+) diff --git a/php/classes/class-qsm-results-pages.php b/php/classes/class-qsm-results-pages.php index 2f7d6e46..d74b6615 100644 --- a/php/classes/class-qsm-results-pages.php +++ b/php/classes/class-qsm-results-pages.php @@ -180,6 +180,7 @@ public static function generate_pages( $response_data ) { // variables, and then outputs the text. $page = wp_kses_post( htmlspecialchars_decode( $content, ENT_QUOTES) ); + $response_data['result_page_index'] = $index; //last chance to filter $page $page = apply_filters( 'qsm_template_variable_results_page', $page, $response_data ); From c095ba79070d8ae2a61934d61179e533ca5ab6fd Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Fri, 18 Oct 2024 12:34:02 +0530 Subject: [PATCH 09/11] Override the individual quiz text data in quiz options --- php/classes/class-qsm-settings.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/php/classes/class-qsm-settings.php b/php/classes/class-qsm-settings.php index 5046ca6e..25be0d6b 100644 --- a/php/classes/class-qsm-settings.php +++ b/php/classes/class-qsm-settings.php @@ -471,13 +471,7 @@ public function get_quiz_options() { } $text = $this->get_setting('quiz_text'); - if ( is_array($text) ) { - foreach ( $text as $key => $value ) { - if ( ! empty($value) ) { - $quiz_options[ $key ] = $value; - } - } - } + $quiz_options = array_merge( $quiz_options, $text ); // Return as old object model return (object) $quiz_options; From 2bcb27df2b31825f46ec163045d6d63c41a36e7e Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Fri, 18 Oct 2024 13:13:55 +0530 Subject: [PATCH 10/11] added previous condition --- php/classes/class-qsm-settings.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/php/classes/class-qsm-settings.php b/php/classes/class-qsm-settings.php index 25be0d6b..2053d265 100644 --- a/php/classes/class-qsm-settings.php +++ b/php/classes/class-qsm-settings.php @@ -471,6 +471,13 @@ public function get_quiz_options() { } $text = $this->get_setting('quiz_text'); + if ( is_array($text) ) { + foreach ( $text as $key => $value ) { + if ( ! empty($value) ) { + $quiz_options[ $key ] = $value; + } + } + } $quiz_options = array_merge( $quiz_options, $text ); // Return as old object model From 2e22491457d72375a073f660b34b08c59c28f950 Mon Sep 17 00:00:00 2001 From: PranavAwasthi Date: Fri, 18 Oct 2024 16:00:58 +0530 Subject: [PATCH 11/11] fix condition to merge text array --- php/classes/class-qsm-settings.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/php/classes/class-qsm-settings.php b/php/classes/class-qsm-settings.php index 2053d265..916afe61 100644 --- a/php/classes/class-qsm-settings.php +++ b/php/classes/class-qsm-settings.php @@ -472,13 +472,8 @@ public function get_quiz_options() { $text = $this->get_setting('quiz_text'); if ( is_array($text) ) { - foreach ( $text as $key => $value ) { - if ( ! empty($value) ) { - $quiz_options[ $key ] = $value; - } - } + $quiz_options = array_merge( $quiz_options, $text ); } - $quiz_options = array_merge( $quiz_options, $text ); // Return as old object model return (object) $quiz_options;