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

Use of Top category of the quiz in random question leads to notenoughrandomquestions error.

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_404_STABLE, MOODLE_405_STABLE

      There is a couple of problems with random questions and question categories in mod_quiz.

      The first problem

      When you attempt the quiz you get this error message

      There are not enough questions in category 1 to create the question Random question (1).

      More information about this error (https://docs.moodle.org/405/en/error/quiz/notenoughrandomquestions)

      Debug info:

      Error code: notenoughrandomquestions

      Stack trace:

      • line 241 of /mod/quiz/locallib.php: core\exception\moodle_exception thrown
      • line 2060 of /mod/quiz/locallib.php: call to quiz_start_new_attempt()
      • line 110 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()

      Desired behaviour

      • Only categories that potentially can contain questions should be offered as random question categories or the random question should link to all the questions and categories within the chosen category even if the category itself cannot contain questions (like top categories).
      • The random question shows and uses the category set, not another category.
      • No errors occur.

      Steps

      1. Create a quiz.
      2. Create a couple of questions in Default for the quiz category.
      3. Create a couple of random questions in the quiz. Choose the Top for the quiz category.
      4. See the category is not what you chose when you created random questions.
      5. You may also set the category to Top for the quiz again. In random question it may show the top category but in the questions interface in the quiz there the system shows another category.
      6. Try to preview or attempt the quiz.

      If you duplicate the quiz the copy has the problem as well.

      The second problem is here https://tracker.moodle.org/browse/MDL-83597 and I think it's related.

            Unassigned Unassigned
            андрейусков Андрей Усков
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 22 minutes
                22m

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