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

Selecting variants in a quiz can fail if later questions have fewer variants

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9.6, 3.0.4, 3.2.3, 3.3.1
    • Fix Version/s: None
    • Component/s: Questions
    • Testing Instructions:
      Hide
      1. Create a quiz
      2. Add a calculated question
      3. This question should be setup to have a shared wildcard X with 10 datasets with the set synchronized
      4. Add another calculated question
      5. This question should be setup to have a shared wildcard Y with at least 2 datasets (or some number less than X has. The bigger the difference the more likely to trip the error) with the set synchronized.
      6. Have the X and Y wildcards in each questions text body so you can verify different values for X being chosen when previewing.
      7. Preview the quiz - keep clicking the start new preview button

      Expected outcome:

      1. Quiz is displayed

      Actual outcome:

      1. As soon as variant is picked for Q1 that is higher than the number available for Q2, you'll get a fatal error.
      Show
      Create a quiz Add a calculated question This question should be setup to have a shared wildcard X with 10 datasets with the set synchronized Add another calculated question This question should be setup to have a shared wildcard Y with at least 2 datasets (or some number less than X has. The bigger the difference the more likely to trip the error) with the set synchronized. Have the X and Y wildcards in each questions text body so you can verify different values for X being chosen when previewing. Preview the quiz - keep clicking the start new preview button Expected outcome: Quiz is displayed Actual outcome: As soon as variant is picked for Q1 that is higher than the number available for Q2, you'll get a fatal error.
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE

      Description

      When starting a quiz, a variant is chosen for each question. The strategy then reuses that same variant no matter how many are actually available in alter questions.

      Example
      Q1 has shared wildcard X with 10 datasets
      Q2 has shared wildcard Y with 5 datasets

      When starting the quiz, a variant is chosen for Q1. If it happens to choose anything larger than 5, you'll just end up with a moodle exception (cannotgetdsfordependent, question).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tlock Tim Lock
                Reporter:
                aolley Adam Olley
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: