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

Quiz redo-question: PHP notice in a particular edge case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.9.5, 3.0.3
    • 2.9.4, 3.0.2, 3.1
    • Questions
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • Hide
      1. Make sure developer debug is on.
      2. Create a new quiz with question bahaviour: Immediate feedback, and Show more... -> Allow redo: On.
      3. Edit quiz.
      4. Add a random question, creating a new category.
      5. In the question bank, create 2 Simple calculated questions in that category, each with 10 datasets.
      6. Attempt the quiz as a student.
      7. Answer the question, then click the redo button.
      8. Verify that there are no PHP notices.

      If you can be bothered, revert the change in mod/quiz/attemptlib.php, but leave the change in least_used_strategy. Repeat the above test and verify that you get a debugging message that explains the problem.

      Show
      Make sure developer debug is on. Create a new quiz with question bahaviour: Immediate feedback, and Show more... -> Allow redo: On. Edit quiz. Add a random question, creating a new category. In the question bank, create 2 Simple calculated questions in that category, each with 10 datasets. Attempt the quiz as a student. Answer the question, then click the redo button. Verify that there are no PHP notices. If you can be bothered, revert the change in mod/quiz/attemptlib.php, but leave the change in least_used_strategy. Repeat the above test and verify that you get a debugging message that explains the problem.

      Steps to reproduce:

      1. Make sure developer debug is on.
      2. Create a new quiz with question bahaviour: Immediate feedback, and Show more... -> Allow redo: On.
      3. Add a random question, creating a new category.
      4. In the question bank, create 2 Simple calculated questions in that category, each with 10 datasets.
      5. Attempt the quiz as a student.
      6. Answer the question, then click the redo button.

      Expected result: No errors.

      Acutal result:
      [10-Feb-2016 13:45:13 Europe/London] PHP Notice: Undefined index: learn2.open.ac.uk+140129140739+KtJfMv in /srv/learn2.open.ac.uk/www/html/question/classes/engine/variants/least_used_strategy.php on line 93

      Also, it was not actually using the variant that it had carefully selected.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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