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

Use auto-saved responses when a quiz attempt is submitted automatically

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6.1
    • Fix Version/s: 2.5.5, 2.6.2
    • Component/s: Questions, Quiz
    • Labels:
    • Testing Instructions:
      Hide

      Note that the unit tests provide quite good coverage of this.

      1. Ensure that quiz auto-save is turned on in the admin menu. Set it to 1 minute.
      2. Create a quiz with 'When time expires' set to 'Attempts are submitted automatically', and with a time-limit of 3 minutes.
      3. Add one question to the quiz. (E.g. a true-false question.)
      4. As a student, start an attempt at the quiz.
      5. Select/input the right answer to Q1, but don't do anything else. Just wait 1 minute for the auto-save to happen. (Developer tools watching then network traffic will let you confirm that.)
      6. Now (before the quiz time-limit expires) close the browser window or log out of Moodle (ignoring the 'unsaved data in form' warning).
      7. Wait 2 more minutes, until the quiz time limit has definitely expired.
      8. Log back in as the student, and go back to the quiz. The attempt should now show as Finished, and you should have got full marks.
      9. Review the attempt to make sure that is the case.
      Show
      Note that the unit tests provide quite good coverage of this. Ensure that quiz auto-save is turned on in the admin menu. Set it to 1 minute. Create a quiz with 'When time expires' set to 'Attempts are submitted automatically', and with a time-limit of 3 minutes. Add one question to the quiz. (E.g. a true-false question.) As a student, start an attempt at the quiz. Select/input the right answer to Q1, but don't do anything else. Just wait 1 minute for the auto-save to happen. (Developer tools watching then network traffic will let you confirm that.) Now (before the quiz time-limit expires) close the browser window or log out of Moodle (ignoring the 'unsaved data in form' warning). Wait 2 more minutes, until the quiz time limit has definitely expired. Log back in as the student, and go back to the quiz. The attempt should now show as Finished, and you should have got full marks. Review the attempt to make sure that is the case.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This came from this quiz forum discussion: https://moodle.org/mod/forum/discuss.php?d=252031

      Normally, when we process some new data, we ignore the previous auto-saved data. (There is no point keeping the auto-save in the response history, if there is now a real save or submit of a response.) So, at the moment autosaved data is used when a question_attempt is viewed (rendered) but not when it is updated.

      However, when processing a finish action, we should use any autosaved responses (presumably converting them into a real save first).

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Sam Marshall
            Integrator:
            Damyon Wiese
            Tester:
            Frédéric Massart
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Mar/14