-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.2
-
MOODLE_401_STABLE
-
MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-78008_401 -
This is issue B described in MDL-77080. Some cloze questions (qtype_multianswer) can have missing subquestions. Those can lead to the scheduled task \quiz_statistics\task\recalculate failing. In MDL-54724 most problems around missing subquestions have been fixed, but this has been missed.
Error in Moodle 4.1.2:
Scheduled task failed: Fragestatistiken neu berechnen (quiz_statistics\task\recalculate),Fehler in der Kodierung gefunden, den nur Programmierer/innen korrigieren können: Unknown question type subquestion_replacement
|
Backtrace:
|
* line 319 of /question/type/multianswer/questiontype.php: call to question_bank::get_qtype()
|
* line 472 of /question/classes/statistics/questions/calculator.php: call to qtype_multianswer->get_random_guess_score()
|
* line 82 of /question/classes/statistics/questions/calculator.php: call to core_question\statistics\questions\calculator->get_random_guess_score()
|
* line 647 of /mod/quiz/report/statistics/report.php: call to core_question\statistics\questions\calculator->__construct()
|
* line 950 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->get_all_stats_and_analysis()
|
* line 108 of /mod/quiz/report/statistics/classes/task/recalculate.php: call to quiz_statistics_report->calculate_questions_stats_for_question_bank()
|
* line 259 of /lib/cronlib.php: call to quiz_statistics\task\recalculate->execute()
|
* line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
|
* line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
|
* line 178 of /admin/cli/cron.php: call to cron_run()
|
In combination with the fix for MDL-75576 making it so quiz statistics are only ever calculated in cron and not "on-the-fly" anymore this issue can lead to lots of quizzes not showing any statistics anymore.
MDL-54724 describes one way to create cloze questions with missing sub questions through normal use in an old Moodle version. Here is how you can artificially create such a question and evoke the error:
- Create a quiz.
- Add a new question of qtype_multianswer with the text from the attached file "question-text-example.txt" to it.
- Modify the corresponding entry in the question_multianswer table by hand to contain one additional question id in the sequence column (no question must exist for that id!)
- Purge the "other" cache.
- Take and submit the quiz as a student.
- Run the \quiz_statistics\task\recalculate task.
- has a non-specific relationship to
-
MDL-54724 Investigate and fix invalid question_multianswer sequence
- Closed
- has been marked as being related by
-
MDL-77378 Cloze question where all subquestions have zero weight cause Division by zero errors
- Closed
- split from
-
MDL-77080 Exceptions when running Recalculate question statistics scheduled task
- Closed