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

question_variant_pseudorandom_no_repeats_strategy is insufficiently random

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5.2
    • Fix Version/s: 2.4.8, 2.5.4
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a quiz:
        • do not set 'Each attempt builds on last'.
        • Allow unlimited attetmps.
        • add at least two calculated questions, each with a few dataset items, a different number of datasets each. (4 and 3 datasets each might be a good choice.)
      2. Duplicate the quiz.
      3. Start an attempt at each copy of the quiz with the same student user account.
        • VERIFY that you see different variants of each question. (Note there is a 1 in 12 change that the students actually see the same variant of both questions just be chance. If that happens test with another student or two, to check that they see different variants.)
        • NOTE the dataset values you are seeing.
      4. Submit that attempt, and start another.
        • NOTE the dataset values you are seeing.
      5. Repeat until you get back to the dataset value you started with for each question.
        • VERIFY that you saw all the dataset values before you saw a repeat.
      Show
      Create a quiz: do not set 'Each attempt builds on last'. Allow unlimited attetmps. add at least two calculated questions, each with a few dataset items, a different number of datasets each. (4 and 3 datasets each might be a good choice.) Duplicate the quiz. Start an attempt at each copy of the quiz with the same student user account. VERIFY that you see different variants of each question. (Note there is a 1 in 12 change that the students actually see the same variant of both questions just be chance. If that happens test with another student or two, to check that they see different variants.) NOTE the dataset values you are seeing. Submit that attempt, and start another. NOTE the dataset values you are seeing. Repeat until you get back to the dataset value you started with for each question. VERIFY that you saw all the dataset values before you saw a repeat.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Steps to reproduce:

      1. Create a quiz using calculated questions.
      2. Duplicate that quiz.
      3. Start an attempt at each quiz using the same student account.

      Actual result: you get the same variant of each quiz in both attempts.

      Expected result: you get a different random variant in each quiz.

      See also https://moodle.org/mod/forum/discuss.php?d=216025

      The problem is with question_variant_pseudorandom_no_repeats_strategy. That only uses the userid, information from the question, and the quiz attempt number as input to the randomisation.

      We should also include some element specific to the quiz (or other thing using the question). Possibily contextid or quizid?

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Pierre Pichet
            Integrator:
            Damyon Wiese
            Tester:
            Andrew Nicols
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/14