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

Previewing randomly shuffled quiz generates exception



    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 2.3
    • None
    • Quiz


      When I preview a quiz that has randomly shuffled questions Moodle generates this exception:

      Coding error detected, it must be fixed by a programmer: Unknown question type (no definition) randomsamatch

      More information about this error
      Debug info:
      Error code: codingerror
      Stack trace:

      line 237 of /question/engine/bank.php: coding_exception thrown
      line 659 of /question/type/questiontypebase.php: call to question_bank::load_question_definition_classes()
      line 646 of /question/type/questiontypebase.php: call to question_type->make_question_instance()
      line 278 of /question/engine/bank.php: call to question_type->make_question()
      line 186 of /mod/quiz/startattempt.php: call to question_bank::make_question()

      To recreate:

      Test Pre-requisites:
      A quiz with Question order set to: "Shuffled randomly" and "New page" set to "Every 2 questions".

      Test Steps:
      1. Navigate to the quiz and select the [Show] link adjacent to "Question bank contents". Check that the question bank is shown.
      2. Create a question of each type.
      3. Click the "Select all" checkbox in the questions bank and click "< Add to quiz". Verify that all of the questions are moved to pages, two per page.
      4. Preview the quiz twice and verify that the second time that the questions are in a different order to the first.

      Expected result:
      I can preview the quiz any number of times.

      Actual result:
      When I try to preview the quiz Moodle throws the above exception.


        Issue Links



              timhunt Tim Hunt
              timb Tim Barker
              Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              0 Vote for this issue
              0 Start watching this issue