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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.6, 3.6.4
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Quiz
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rezaie9 Shamim Rezaie
                Reporter:
                timhunt Tim Hunt
                Peer reviewer:
                Tim Hunt
                Integrator:
                Andrew Nicols
                Tester:
                CiBoT
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

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