Processing module function quiz_cron ... Looking for quiz overdue quiz attempts... PHP Notice: Undefined offset: 450821 in /var/moodle/mod/quiz/attemptlib.php on line 668 Notice: Undefined offset: 450821 in /var/moodle/mod/quiz/attemptlib.php on line 668 PHP Notice: Trying to get property of non-object in /var/moodle/mod/quiz/attemptlib.php on line 668 Notice: Trying to get property of non-object in /var/moodle/mod/quiz/attemptlib.php on line 668 PHP Warning: Creating default object from empty value in /var/moodle/mod/quiz/attemptlib.php on line 673 Warning: Creating default object from empty value in /var/moodle/mod/quiz/attemptlib.php on line 673 Error while processing attempt 235954 at 15583 quiz: Coding error detected, it must be fixed by a programmer: There is no question_attempt number 450821 in this attempt. #0 /var/moodle/question/engine/questionusage.php(277): question_usage_by_activity->check_slot('450821') #1 /var/moodle/question/engine/questionusage.php(224): question_usage_by_activity->get_question_attempt('450821') #2 /var/moodle/mod/quiz/attemptlib.php(1128): question_usage_by_activity->get_question('450821') #3 /var/moodle/mod/quiz/attemptlib.php(686): quiz_attempt->is_real_question('450821') #4 /var/moodle/mod/quiz/attemptlib.php(575): quiz_attempt->number_questions() #5 /var/moodle/mod/quiz/cronlib.php(78): quiz_attempt->__construct(Object(stdClass), Object(stdClass), Object(stdClass), Object(stdClass)) #6 /var/moodle/mod/quiz/lib.php(535): mod_quiz_overdue_attempt_updater->update_overdue_attempts(1499962922, 1499962862) #7 /var/moodle/lib/classes/task/legacy_plugin_cron_task.php(93): quiz_cron() #8 /var/moodle/lib/cronlib.php(75): core\task\legacy_plugin_cron_task->execute() #9 /var/moodle/admin/cli/cron.php(61): cron_run() #10 {main} Considered 0 attempts in 1 quizzes.
Some followup sleuthing:
This quiz appears in a course from 2012.
SELECT * FROM mdl_quiz WHERE id = 15583\G *************************** 1. row *************************** id: 15583 course: 10015 name: QUIZ # 8 (4.2 - 4.4) intro: introformat: 1 timeopen: 1339502400 timeclose: 1340139600 preferredbehaviour: deferredfeedback canredoquestions: 0 attempts: 1 attemptonlast: 0 grademethod: 3 decimalpoints: 2 questiondecimalpoints: -1 reviewattempt: 69904 reviewcorrectness: 69904 reviewmarks: 69904 reviewspecificfeedback: 69648 reviewgeneralfeedback: 69648 reviewrightanswer: 16 reviewoverallfeedback: 4096 questionsperpage: 10 shuffleanswers: 1 sumgrades: 10.00000 grade: 10.00000 timecreated: 0 timemodified: 1339459714 timelimit: 0 overduehandling: autoabandon graceperiod: 0 password: subnet: browsersecurity: - delay1: 0 delay2: 0 showuserpicture: 0 showblocks: 0 completionattemptsexhausted: 0 completionpass: 0 navmethod: free
SELECT * FROM mdl_quiz_attempts WHERE id = 235954\G *************************** 1. row *************************** id: 235954 uniqueid: 235954 quiz: 15583 userid: 16116 attempt: 1 sumgrades: 0.00000 timestart: 1339509684 timefinish: 0 timemodified: 1339509684 timecheckstate: 1340139600 layout: 5,1,6,450821,8,2,7,4,3,9,0 preview: 0 state: inprogress currentpage: 0
If I visit the quiz attempt itself (requires authentication, mostly linking for myself later), I get a similar error:
Coding error detected, it must be fixed by a programmer: There is no question_attempt number 450821 in this attempt.
Error code: codingerror
- line 263 of /question/engine/questionusage.php: coding_exception thrown
- line 277 of /question/engine/questionusage.php: call to question_usage_by_activity->check_slot()
- line 224 of /question/engine/questionusage.php: call to question_usage_by_activity->get_question_attempt()
- line 1128 of /mod/quiz/attemptlib.php: call to question_usage_by_activity->get_question()
- line 686 of /mod/quiz/attemptlib.php: call to quiz_attempt->is_real_question()
- line 575 of /mod/quiz/attemptlib.php: call to quiz_attempt->number_questions()
- line 593 of /mod/quiz/attemptlib.php: call to quiz_attempt->__construct()
- line 603 of /mod/quiz/attemptlib.php: call to quiz_attempt::create_helper()
- line 45 of /mod/quiz/review.php: call to quiz_attempt::create()
Moodle 3.1.2 (Build: 20160912)
Moodle mod_quiz version 2016052300