[AMOS commit] MDL-54724 qtype_multianswer: Better handle corrupted questions Committed into Git: 2022-02-11 03:08 UTC

[AMOS commit] MDL-54724 qtype_multianswer: Better handle corrupted questions Committed into Git: 2022-02-11 03:08 UTC

by AMOS bot -
Number of replies: 0
Author: Cameron Ball
MDL-54724 qtype_multianswer: Better handle corrupted questions
When questions are deleted, we now check if the parent is in use before deletion.

Prior to this, it would be possible for multianswer questions to reference
questions that have been deleted. This results in fatal errors when the quiz
is viewed.

This patch uses a dummy 'subquestion_replacement' to handle this case and
display some information to the end user about what has happened so that
they may take action to repair the corrupted question.

As a result of the bug described above, the sequence column of
mdl_question_multianswer can contiain references to questions that no
longer exist, and these IDs can make their way in to backups.

When this happens, the backups cannot be restored. To avoid this,
this patch skips trying to restore those questions that reference
question IDs that no longer exist (as there is no way to recover them).


http://git.moodle.org/gw?p=moodle.git;a=commit;h=83b783606890f6b23849d570b86b7aabc6ed613e
http://github.com/moodle/moodle/commit/83b783606890f6b23849d570b86b7aabc6ed613e

+ 3.11 en [corruptedquestion,qtype_multianswer]
+ 3.11 en [missingsubquestion,qtype_multianswer]