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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.4, 3.0.2, 3.1
    • Fix Version/s: 2.9.5, 3.0.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Mar/16