• 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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi Sotiris,

    Sorry for any inconvenience you had. I will definitely help you to find a solution to the issue you are having. Can you please provide us below-given information for troubleshooting purposes?

    1. Quiz link where you face such an issue.
    2. PHP version of the website
    3. WP version of the website
    4. Database version.
    5. Error Log.

    Expecting your kind cooperation in this case and we are always here to assist you.

    Regards,
    sumit

    I have the same problem after update 8.0 The problem is that the questions does not displayed randomly. The same questions appear every time we refresh the page.
    Only after answer the quiz appear new randomly questions.

    https://users.sch.gr/nobody/wordpress/

    Thanks

    Hi @nobody3009

    As I check your quiz there is no such issue found. Can you please clear the cache and then check. Let me know if you still face the same issue.

    Regards,
    sumit

    I did it. I check it and with different browsers. The issue exists.
    Before the update after every new load of page the questions were renewing.
    Now are renewing only after submission of answers.

    Regards

    • This reply was modified 2 years, 5 months ago by nobody3009.

    Hi @nobody3009

    Can you please provide the below-given information for troubleshooting purposes?

    1. QSM version you are using right now.
    2. WP version
    3. PHP Version
    4. Database version
    5. Error log of your website.

    Please provide the above-mentioned information as soon as possible so that we can check for the issue.

    Regards,
    sumit

    QSM version you are using right now : 8.0.2
    2. WP version : 5.9.3
    3. PHP Version : 7.4.11
    4. Database version : mysqlnd 7.4.11
    5. Error log of your website : There isn’t error.

    Hi @nobody3009 ,

    Thank you for sharing this information. I need to discuss this with my development team. Hopefully, I will get back to you with the solution.

    Regards,
    Sumit

    I rollback to version 7.3.14 and the problem has been fixed.

    Hi @nobody3009

    This is the correct behavior. Users will only see a new set of questions after submitting the quiz, after clearing the cache, or when opening the same quiz in a different browser.

    Let me know if you need more help.

    Regards,
    sumit

    Thanks for the support.

    A question:
    What is the maximum number of questions a quiz can contain?
    (From which 10 questions are randomly selected?)

    Hi @nobody3009

    There is no such limit set in our plugin but for best results, I advise you to use approx 100-150 questions. Please let me know if you need more help.

    Regards,
    sumit

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Issue when using random questions with question limit’ is closed to new replies.