Moodle 3.9.9+ (Build: 20210812)
Embedded questions progress (report_embedquestion) v2020062800
Embed questions (filter_embedquestion) - v2020061000
When using the Embed Quiz Questions feature in Moodle via the Atto text editor, if an Instructor or Student views their "Embedded question progress report" their previous attempt history disappears if you reset your attempt within the embedded question by pressing "Start again"
Steps to replicate:
- Create a simple multiple choice Quiz question (default settings excepting an ID number) and have it located within a Category with an ID number so it is usable for embedding purposes
- Create any Activity with HTML editing options (E.g. Page activity)
- Embed the Quiz question created in step 1 into this activity (use all defaults)
- Log in as user with a Student role, attempt and submit the embedded question via the "check" button
- Log in as a user with an Instructor/Teacher role and view the Embedded questions progress report. Observe that the student entry from step 4 is visible
- Log back in as the student, click "Start again" on the embedded question to reset it
- Log back in as the Instructor and view/refresh the embedded questions report. Observe the Student's entry from step 5 is now not visible (shows "Nothing to display")
- Log back in as the Student, re-attempt the embedded question and submit
- Log back in as the Instructor and view the embedded questions report again. Observe the Student's entry comes back, incl. information on prior attempts.
This behaviour seems to infer data loss is occurring under these circumstances which is not ideal for the consistency/accuracy of record-keeping. As I am submitting this on behalf of an institution who has raised concern with this behaviour, they asked for confirmation of whether this is intended function, a bug or if so intended, recommend improvement to stop this from occurring.
Bearing in mind I am greener than green with coding logic, I have nonetheless tried to look at the coding for moodle-filter_embedquestion/classes/attempt.php and moodle-report_embedquestion/classes/attempt_storage.php in the respective Github repos to see if I can find any clues as to what happens with an attempt when you click "Start again". Looking here at line 438 I can see 'data-formchangechecker-non-submit' => 1]. This looks to me like an instruction being sent when users click Start again to change the database value for the prior attempt to flag it as non-submitted state until a new attempt submit resets that flag.
Looking here it looks like the embedded questions report is looking for specific context info to call a report for view. My guess is that the flag for a non-submitted state might preclude it as valid, therefore no data is returned in the report until something new is submitted. Step 9 above is likely due to the mention [here|https://github.com/moodleou/moodle-filter_embedquestion/blob/main/internaldoc/functionality.txt] that "All interactions with a question (Start, View, Submit) are logged"
Please feel free to ignore the last two paragraphs should they be completely irrelevant. Chalk it up to amateur ignorance, but I would appreciate some programatic understanding of why this might be occurring if you can spare the time to summarise.
TIA for looking into this.