Hi,
We’re facing an issue with Moodle core activity quiz using core question type multiple choice.
Software version: Moodle 4.1.6+ (Build: 20231020) recently upgraded from 3.9
Server checks: Everything is ok, green as a pasture.
The issue:
Some newly created quizzes (not all quizzes, first headache) break apart when a teacher edit a question in the Questions Bank (eg. edit the body of a question).
Important: question type is a core one and works fine in other quizzes.
Breaking apart in Questions tab and Preview Quiz page.
The “Questions” tab is no longer available responding the following error:
Exception - Argument 1 passed to mod_quiz\question\bank\qbank_helper::get_version_options() must be of the type int, string given, called in [dirroot]/mod/quiz/classes/structure.php on line 699
Debug info:
Error code: generalexceptionmessage
Stack trace:
line 46 of /mod/quiz/classes/question/bank/qbank_helper.php: TypeError thrown line 699 of /mod/quiz/classes/structure.php: call to mod_quiz\question\bank\qbank_helper::get_version_options() line 767 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\structure->get_version_choices_for_slot() line 545 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\output\edit_renderer->question() line 518 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\output\edit_renderer->question_row() line 93 of /mod/quiz/classes/output/edit_renderer.php: call to mod_quiz\output\edit_renderer->questions_in_section() line 211 of /mod/quiz/edit.php: call to mod_quiz\output\edit_renderer->edit_page()
Preview quiz, on the other hand, respond this after clicking “Start attempt”:
Coding error detected, it must be fixed by a programmer: This question is of a type that is not installed on your system. No processing is possible.
Debug info:
Error code: codingerror
Stack trace:
line 85 of /question/type/missingtype/question.php: coding_exception thrown line 364 of /question/behaviour/behaviourbase.php: call to qtype_missingtype_question->start_attempt() line 1064 of /question/engine/questionattempt.php: call to question_behaviour->init_first_step() line 582 of /question/engine/questionusage.php: call to question_attempt->start() line 257 of /mod/quiz/locallib.php: call to question_usage_by_activity->start_all_questions() line 2690 of /mod/quiz/locallib.php: call to quiz_start_new_attempt() line 113 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()
And in the browser console:
POST **********/mod/quiz/startattempt.php 404 (Not Found)
It kind of feels like https://tracker.moodle.org/browse/MDL-74452 but it’s a solved issue relevant to older Moodle versions.
Since I’m not able to reproduce the bug with a step-by-step procedure I don’t feel like commenting on that issue but it’s still a pretty crippling and troublesome situation.
Does anyone have a clue?
Thanks!