Issue when using random questions with question limit
-
Hi
I took administration of a website recently that use the plugin Quiz And Survey Master and I face one issue when using random questions.
I have set to display total 20 random questions of one Quiz that contains 124 Questions total.
The problem is that the questions does not displayed randomly. The same questions appear every time we refresh the page.
I have solve temporaly the problem by Editing quiz-master-next/php/classes/class-qmn-quiz-manager.php file and commenting out the line 682:
// $order_by_sql = ‘ORDER BY FIELD(question_id,’.$question_sql.’)’;The variable $order_by_sql was appropriate declared with value ‘ORDER BY rand()’ at line 577 inside the if statement that is true when using random setting:
if ( 1 == $quiz_options->randomness_order || 2 == $quiz_options->randomness_order ) {
$order_by_sql = ‘ORDER BY rand()’;
…..
}A new value is then assigned to the variable $order_by_sql inside the if statement of line 666, before closing. It’s the line 682 I’ve commenting out.
Why changing the value of $order_by_sql before SELECT query?
I was made the last update with Hotfix of version 8.0.1 (June 17, 2022) but the problem doesn’t solved.
Any help are welcome.
Thank you in advance!
Regards
Sotiris
- The topic ‘Issue when using random questions with question limit’ is closed to new replies.