-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.6, 4.1, 4.1.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_400_STABLE, MOODLE_401_STABLE
-
MDL-76298_401 -
I worked out the real problem here. To reproduce.
- Go to the question bank.
- Choose 'Create question' and select Drag-drop into image.
- Set the Question name, Question text and upload a background image.
- Click Save changes.
Expected result: You get validation errors telling you that you must define at least on drag item.
Actual result: The question is saved, even though it cannot possibly work.
The errors when computing the statistics are just a side-effect of this, but since people have bad quesitons in their databases, we need to make that calculation robust too.
Original bug report follows:
This task fails to run in our Moodle 4.1dev+ environment (PHP 8.0, Redis 6, Apache 2.4, MariaDB 10.5):
Execute scheduled task: Vraagstatistieken opnieuw berekenen (quiz_statistics\task\recalculate)
... started 13:30:02. Current memory use 5.4 MB.
Debugging increased temporarily due to faildelay of 1920
... used 15169 dbqueries
... used 9.6491088867188 seconds
Scheduled task failed: Vraagstatistieken opnieuw berekenen (quiz_statistics\task\recalculate),Division by zero
Backtrace:
- line 151 of /question/type/ddimageortext/questiontypebase.php: call to qtype_ddtoimage_question_base->get_random_guess_score()
- line 471 of /question/classes/statistics/questions/calculator.php: call to qtype_ddtoimage_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 642 of /mod/quiz/report/statistics/report.php: call to core_question\statistics\questions\calculator->__construct()
- line 941 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->get_all_stats_and_analysis()
- line 83 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()
- has been marked as being related by
-
MDL-78329 Drag and drop into text question with no places causes Division by zero error
-
- Open
-
-
MDL-77080 Exceptions when running Recalculate question statistics scheduled task
-
- Closed
-
-
MDL-77912 \quiz_statistics\task\recalculate exception for mulitple choice questions with no choices
-
- Closed
-
- is a regression caused by
-
MDL-74762 Statistics in the Moodle 4.0 question bank use many DB queries causing performance problems
-
- Closed
-
- is duplicated by
-
MDL-69771 mod_quiz: Attempts with Drag and drop onto image breaks Results / Statistics page
-
- Closed
-