On Moodle 3.2
We've had an alarming situation arise recently. On fully completed, graded quiz attempts, the students' answers are missing. Not only is this a problem in and of itself, but it's also causing issues for navigation through the courses because of activity restrictions we've set up. Even though they have a completed quiz attempt, it won't allow them to advance to the next activity until the quiz is completed.
After initial investigation, it would appear that this has happened for quizzes going back several years, which I find hard to believe...it would have come up before now. So my working theory is that there is corruption in the db somewhere that is causing this, but so far have not found it.
I haven't found a common thread between which attempts are like this, and which ones are fine. We've also found that submitting a new attempt will grade properly and allow the student to move on.
When attempting to access an attempt with missing answers we get the error "Unexpected Question state".
Here's the full debug output:
Coding error detected, it must be fixed by a programmer: Unexpected question state.
More information about this error
Debug info:
Error code: codingerror
Stack trace:
- line 297 of /question/engine/states.php: coding_exception thrown
- line 617 of /question/engine/questionattempt.php: call to question_state_notstarted->get_state_class()
- line 2435 of /mod/quiz/attemptlib.php: call to question_attempt->get_state_class()
- line 333 of /mod/quiz/renderer.php: call to quiz_nav_panel_base->get_question_buttons()
- line 1659 of /mod/quiz/attemptlib.php: call to mod_quiz_renderer->navigation_panel()
- line 255 of /mod/quiz/review.php: call to quiz_attempt->get_navigation_panel()