Skip to content

Commit

Permalink
fixed Issue while limiting questions by category and randomizing ques…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
zubairraeen committed Nov 10, 2023
1 parent f3fde34 commit d43753b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit d43753b

Please sign in to comment.