-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.6, 4.1.1
Steps to replicate:
- Create a test course.
- Create a quiz.
- Access question bank and add a Description question.
- Access Questions tab of the quiz.
- Set Maximum grade to 0 and save.
- Login as a student.
- Attempt the quiz and finish your attempt.
- Run the scheduled task and observe the error:
root@01c31895db1b:/var/www/vanilla-moodle-master# php admin/cli/scheduled_task.php --execute='\quiz_statistics\task\recalculate' |
Execute scheduled task: Recalculate question statistics (quiz_statistics\task\recalculate)
|
... started 17:55:16. Current memory use 22.6 MB. |
Examining quiz 'My Quiz' (1) in course Test 1 (2) with most recent attempt at 23/02/23, 17:55:10. |
Calculating statistics for 1 attempts, starting at 23/02/23, 17:55:16 ... |
Exception - ksort(): Argument #1 ($array) must be of type array, null given |
|
|
Error code: generalexceptionmessage
|
|
* line 864 of /mod/quiz/report/statistics/report.php: TypeError thrown |
* line 864 of /mod/quiz/report/statistics/report.php: call to ksort() |
* line 939 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->load_and_initialise_questions_for_calculations() |
* line 105 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 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task() |
|
... used 18 dbqueries |
... used 0.044097185134888 seconds |
Scheduled task failed: Recalculate question statistics (quiz_statistics\task\recalculate),ksort(): Argument #1 ($array) must be of type array, null given |
Backtrace:
|
* line 864 of /mod/quiz/report/statistics/report.php: call to ksort() |
* line 939 of /mod/quiz/report/statistics/report.php: call to quiz_statistics_report->load_and_initialise_questions_for_calculations() |
* line 105 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 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task() |
|
root@01c31895db1b:/var/www/vanilla-moodle-master# |
- duplicates
-
MDL-78838 Recalculate question statistics: coding error
-
- Closed
-
- is duplicated by
-
MDL-78838 Recalculate question statistics: coding error
-
- Closed
-
-
MDL-78818 Scheduled task quiz_statistics\task\recalculate fails always with exception, even that time goes over
-
- Closed
-
-
MDL-79235 Question statistics recalculation task failing on ungraded quizzes with description questions only
-
- Closed
-