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

'(See questions)' of a random question in a quiz leads to a wrong category or an error invalidcategory

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE

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

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

      The second problem

      When you click '(See questions)' of a random question in a quiz you see a wrong category or get an error

      question/invalidcategory

      More information about this error

      Debug info:

      Error code: invalidcategory
      $a contents:

      Stack trace:

      • line 321 of /question/editlib.php: core\exception\moodle_exception thrown
      • line 163 of /question/editlib.php: call to question_build_edit_resources()
      • line 34 of /question/edit.php: call to question_edit_setup()

      Desired behaviour

      • Only categories that potentially can contain questions should be offered as random question categories or the question should include all the questions and categories in 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.
      • Quiz duplication doesn't change random question categories from Top quiz category to Course category.
      • No errors occur.

      Steps

      • Create a quiz.
      • Create a couple of questions in Default for the quiz category.
      • Create a couple of random questions in the quiz. Choose the Top for the quiz category.
      • See the category is not what you chose when you created random questions.
        You may also set the category to Top for the quiz again. In the random question it may show the top category but in the questions interface in the quiz the system shows another category.
      • Click '(See questions)' of a random question in the questions interface of the quiz.

      If you duplicate the quiz it shows Default for the course question category.
      Change the category of random questions to Top for the quiz copy and click '(See questions)' to see the error instead of course category.
      In Moodle 4.1 you get this problem in a copy of the test.

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

              Created:
              Updated:

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