From d43753b18640685c2133d087a1db51f307ef2ced Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Fri, 10 Nov 2023 10:48:57 +0530 Subject: [PATCH] fixed Issue while limiting questions by category and randomizing questions --- php/classes/class-qmn-quiz-manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 811dfd99a..2355075cb 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -739,7 +739,7 @@ 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_sql = implode( ',', $question_ids ); if ( 1 == $quiz_options->randomness_order || 2 == $quiz_options->randomness_order ) { - if ( isset( $_COOKIE[ 'question_ids_'.$quiz_id ] ) && empty( $quiz_options->question_per_category ) ) { + if ( isset( $_COOKIE[ 'question_ids_'.$quiz_id ] ) && empty( $quiz_options->question_per_category ) && empty( $quiz_options->limit_category_checkbox ) ) { $question_sql = sanitize_text_field( wp_unslash( $_COOKIE[ 'question_ids_'.$quiz_id ] ) ); if ( ! preg_match("/^\d+(,\d+)*$/", $question_sql) ) { $question_sql = implode( ',', $question_ids );