From f2cab4667c93738206ac0a7e36b209893ce6d3c4 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 12 Sep 2024 13:55:37 +0530 Subject: [PATCH 1/5] update css --- css/qsm-admin.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/qsm-admin.css b/css/qsm-admin.css index 69194075a..63a049e03 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -833,6 +833,7 @@ ul.changelog li.update div.two:before { .qsm_tab_content label { margin-right: 5px; } +.qsm-sub-text-tab-menu, .qsm-sub-tab-menu { display: flex; flex-direction: row; From 2b9dac3982da78075dad820979089bad1bb8dda2 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 12 Sep 2024 14:02:07 +0530 Subject: [PATCH 2/5] update changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index afe42c83c..71ca822ac 100644 --- a/readme.txt +++ b/readme.txt @@ -193,6 +193,7 @@ QSM is designed to be compatible with most WordPress plugins and themes. However * Feature: Added placeholder customization for short answer and paragraph questions * Bug: Resolved vulnerability issue with question settings * Bug: Fixed issue with undefined page redirection +* Bug: Enter key issue resolved in paragraph question type = 9.1.2 ( August 22, 2024 ) = * Bug: Resolved issue preventing global settings from being saved From 523479f53cbd99d4e0e5a4232f8397b4f323bb25 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Thu, 12 Sep 2024 14:49:26 +0530 Subject: [PATCH 3/5] fixed php warning --- php/classes/class-qmn-quiz-manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 0bfc86ef6..6dfecc3b4 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -2404,8 +2404,8 @@ public static function check_answers( $options, $quiz_data ) { $results_array = apply_filters( 'qmn_results_array', $results_array, $question ); // If question was graded correctly. if ( ! isset( $results_array['null_review'] ) ) { - $points_earned += (float)$results_array['points']; - $answer_points += (float)$results_array['points']; + $points_earned += isset($results_array['points']) ? (float)$results_array['points'] : 0; + $answer_points += isset($results_array['points']) ? (float)$results_array['points'] : 0; // If the user's answer was correct. if ( isset( $results_array['correct'] ) && ( 'correct' == $results_array['correct'] ) ) { $total_correct += 1; From be628fa7f433667f893c89dab27b31d1a8fcd270 Mon Sep 17 00:00:00 2001 From: etchirag Date: Tue, 24 Sep 2024 16:06:03 +0530 Subject: [PATCH 4/5] Respove the other files code --- js/qsm-quiz.js | 4 ++-- php/classes/class-qmn-quiz-manager.php | 29 +++++++++++++++++++------- readme.txt | 1 - 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/js/qsm-quiz.js b/js/qsm-quiz.js index 89c3611eb..7ec401320 100644 --- a/js/qsm-quiz.js +++ b/js/qsm-quiz.js @@ -132,7 +132,7 @@ var qsmTimerInterval = []; // Calculates starting time. var timerTotal = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60; var timerStarted = localStorage.getItem('mlw_started_quiz' + quizID); - var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)); + var timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1; var timerRemaning = timerTotal - timerConsumed; if ('yes' == timerStarted && 0 < timerRemaning) { seconds = parseInt(timerRemaning); @@ -357,7 +357,7 @@ var qsmTimerInterval = []; // Calculates starting time. let timerStarted = localStorage.getItem('mlw_started_quiz' + quizID); - let timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)); + let timerConsumed = parseInt(localStorage.getItem('mlw_time_consumed_quiz' + quizID)) || 1; let seconds = parseFloat(qmn_quiz_data[quizID].timer_limit) * 60; let timerRemaning = seconds - timerConsumed; if ('yes' == timerStarted && 0 < timerRemaning) { diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 6dfecc3b4..8d93dff8a 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -929,14 +929,6 @@ public function load_questions( $quiz_id, $quiz_options, $is_quiz_page, $questio $question_ids = apply_filters( 'qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options ); $question_ids = QMNPluginHelper::qsm_shuffle_assoc( $question_ids ); $question_sql = implode( ',', $question_ids ); - ?> - - get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE quiz_id=%d AND deleted=0 %1s %2s %3s", $quiz_id, $question_sql, $order_by_sql, $limit_sql ) ); } + if ( + in_array( intval( $quiz_options->randomness_order ), [ 1, 2 ], true) && + ! empty($questions) && + is_array($questions) && + ! isset($_COOKIE[ 'question_ids_' . $quiz_id ]) + ) { + $question_ids = array(); + foreach ( $questions as $question ) { + $question_ids[] = $question->question_id; + } + + $question_sql = implode(',', array_unique($question_ids)); // Prevent duplicates + ?> + + Date: Tue, 24 Sep 2024 16:07:33 +0530 Subject: [PATCH 5/5] Minor changes to resolve other file change --- php/classes/class-qmn-quiz-manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 8d93dff8a..7ffcadd29 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -2417,8 +2417,8 @@ public static function check_answers( $options, $quiz_data ) { $results_array = apply_filters( 'qmn_results_array', $results_array, $question ); // If question was graded correctly. if ( ! isset( $results_array['null_review'] ) ) { - $points_earned += isset($results_array['points']) ? (float)$results_array['points'] : 0; - $answer_points += isset($results_array['points']) ? (float)$results_array['points'] : 0; + $points_earned += (float)$results_array['points']; + $answer_points += (float)$results_array['points']; // If the user's answer was correct. if ( isset( $results_array['correct'] ) && ( 'correct' == $results_array['correct'] ) ) { $total_correct += 1;