Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 3.1.4, 3.2.1, 3.6.5, 3.7.1
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
-
Fixed Branches:MOODLE_36_STABLE, MOODLE_37_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-58026-master -
Pull Master Diff URL:
Description
Some more background is here: https://moodle.org/mod/forum/discuss.php?d=344367
High level
If a teacher uses the regrade feature on a quiz attempt that is currently in progress and has autosave data, the autosave step data is converted to a true step. When the student attempts to submit their quiz, they will get an out of sequence error ("You have entered data outside the normal sequence", question_out_of_sequence_exception), and all data will be lost from the point of the most recent autosave before the teacher hit regrade.
Details
When a user is attempting a quiz, they are assigned a sequence number in the form, which is the next not submitted sequence (starting at 1, and going up), that way, if they have the quiz open in two windows, they will both get sequence 1. When they hit submit in one (now saving sequence 1 to the DB), if they try to submit from the other, it won't overwrite the answers, because sequence 1 already exists. When they load the page again, then would get sequence 2, since that is the next not used sequence.
Auto-save from a quiz window is saved under the sequence number, but negative (-1, -2, etc).
If there is autosave data (let's say we are working under sequence 2, so autosave is stored as sequence -2), and the attempt is regraded by the teacher (like by hitting regrade all), all the auto-save steps are converted to positive sequence numbers (so -2 becomes 2).
Now two things happen:
- When the user attempts to submit the page, they will get an out of sequence error, and be moved back to the attempt, but all data since the time the teacher hit regrade all is gone (and if time was up, it will immediately resubmit, successfully). The error page is just regular text with a continue button, not styled as a warning/error, so many students don't even realize it's telling them a warning.
- Auto-save silently stops working. Autosave on the page still calls autosave.ajax.php, and that page still returns "OK", which should mean it recorded fine, but in fact, the data isn't recorded in the DB at all. Basically autosave seems to silently ignore out of sequence errors and report OK.
Attachments
Issue Links
- has a non-specific relationship to
-
MDL-57884 Quiz autosave takes the value of the submit button which had not been clicked
-
- Closed
-