-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.0.8, 4.1.3
-
MOODLE_400_STABLE, MOODLE_401_STABLE
If you have:
- a "Drag and drop into text" question that defines no valid places to drop the draggable expressions into,
- a quiz attempt "answering" this question and
- run the "Recalculate question statistics" scheduled task,
you get the following error (in Moodle 4.1.3):
Scheduled task failed: Recalculate question statistics (quiz_statistics\task\recalculate),Division by zero
|
Backtrace:
|
* line 207 of /question/type/gapselect/questiontypebase.php: call to qtype_gapselect_question_base->get_random_guess_score()
|
* line 472 of /question/classes/statistics/questions/calculator.php: call to qtype_gapselect_base->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 263 of /lib/cronlib.php: call to quiz_statistics\task\recalculate->execute()
|
* line 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task()
|
See for example attached question in Moodle XML format. Unfortunately it is not known how that question got created. It was definitely created with an earlier Moodle version. Moodle usually doesn't let you save the question if there are no valid drop zones defined.
Steps to reproduce:
- Import questions-(VO) Pflanzenbiotechnologie-Transformation 2-20230522-1611.xml
into a question bank.
- Create a new quiz using this question.
- Attempt, submit and finish that quiz as a student.
- Run the "Recalculate question statistics" scheduled Task.
- has a non-specific relationship to
-
MDL-76298 Drag drop questions don't validate that drop zones have been defined (causing division by zero errors in the statistics)
-
- Closed
-