-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.5.6
-
None
-
MOODLE_25_STABLE
-
Steps to reproduce:
1. You create a quiz and attempt it without submitting it.
2. You remove one of the choices from moodle backend.
3. Then you resume the attempted quiz choose the removed choice. The removed choice will be empty since you have removed it in moodle.
4. Once you proceed with submission, you will encounter the following error.
Notice: Undefined offset: 4873 in admin\question\type\multichoice\renderer.php on line 76
Notice: Trying to get property of non-object in admin\question\type\multichoice\renderer.php on line 98
Notice: Trying to get property of non-object in admin\question\type\multichoice\renderer.php on line 98
Notice: Trying to get property of non-object in admin\question\type\multichoice\renderer.php on line 106
Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
More information about this error
Debug info: Argument 1 passed to qtype_multichoice_multi_renderer::is_right() must be an instance of question_answer, null given, called in admin\question\type\multichoice\renderer.php on line 117 and defined
Error code: codingerror
Stack trace:
line 397 of \lib\setuplib.php: coding_exception thrown
line 263 of \question\type\multichoice\renderer.php: call to default_error_handler()
line 117 of \question\type\multichoice\renderer.php: call to qtype_multichoice_multi_renderer->is_right()
line 329 of \question\engine\renderer.php: call to qtype_multichoice_renderer_base->formulation_and_controls()
line 81 of \question\engine\renderer.php: call to core_question_renderer->formulation()
line 141 of \question\behaviour\behaviourbase.php: call to core_question_renderer->question()
line 735 of \question\engine\questionattempt.php: call to question_behaviour->render()
line 360 of \question\engine\questionusage.php: call to question_attempt->render()
line 1180 of \mod\quiz\attemptlib.php: call to question_usage_by_activity->render_question()
line 185 of \mod\quiz\renderer.php: call to quiz_attempt->render_question()
line 57 of \mod\quiz\renderer.php: call to mod_quiz_renderer->questions()
line 257 of \mod\quiz\review.php: call to mod_quiz_renderer->review_page()
Expected: Either you disable the admin from modifying the quiz choices, if any of the user attempted the quiz or handle the situation gracefully for the user by forgetting their previously chosen choices.
Affected Version: Observed in 2.4, but couldn't select it in Affects Version.
- duplicates
-
MDL-29853 Changing or deleting answer choices in a quiz after students submit answers can break quiz reviews
-
- Closed
-