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

Quiz allow redo within an attempt with random questions gives an error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.5, 3.7.1
    • 3.5.6, 3.6.4
    • Quiz

      1. In the question bank, create a category 'Random test'.
      2. Create two questions in that category (true-false are quickest to create).
      3. Create a new quiz. Under Question behaviour, click "Show more ..." and set "How questions behave" to "Immediate feedback" and turn on "Allow redo within an attempt".
      4. Edit the quiz, and add "a random question" picking from the existing "Random test" category.
      5. Preview the quiz.
      6. Answer the question and click "Check".
      7. Click the "Try another question like this one" button.

      Expected result: it works.

      Acutal result: Notice: Undefined property: stdClass::$id in /opt/app/mod/quiz/attemptlib.php on line 1903 (If you have debug on.)

      I think in the steps to reproduce above, the error does no harm. However, if the quiz setup was more sophisticated and used randomisation by tags, this would probably be a more serious bug.

            rezaie9 Shamim Rezaie
            timhunt Tim Hunt
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 10 minutes
                3h 10m

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