Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-36694

It is possible to add more random questions than the number that exist in the question bank

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • None
    • 2.3.3
    • Questions, Quiz
    • MOODLE_23_STABLE

      When creating a quiz you can add a limited number of random questions from a category in the question bank. However, there is nothing to stop you from doing this repeatedly.

      Replication steps:

      1. Create a category in the question bank
      2. Add four questions
      3. Create a quiz and add the four questions using the "Add random questions from category" functionality
      4. Repeat the previous step
      5. Preview the quiz

      Expected result: You should not be able to add more random questions than exist in the category

      Actual result: You can add more questions than the number in the category, and when you preview the quiz, the following error is shown...

      There are not enough questions in category 12 to create the question Random (New category 1 and sub-categories) (31).
       
      More information about this error
      Debug info:
      Error code: notenoughrandomquestions
      Stack trace:
       
          line 192 of /mod/quiz/startattempt.php: moodle_exception thrown

            timhunt Tim Hunt
            salvetore Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.