Our Moodle Site (moodle 2.9) has had errors while grading. In some of the assignment activities errors occur while clicking the grading icon. This can happen unrelated to the grade status of the assignment. For example, the following situation:
If I click the grade icon in the top entry I go to the submisison and I can grade it. However if I click the second grade icon I get the next error. I have posted before because I thought it was a microsoft Edge thing, however, it happens in all browsers, so I think something wrong. Is there an installation problem? Is there a fix or a workaround? Is the "grade me" plugin interfering with the installation? (it shouldn't be)
This problem is really interfering with our teaching, so any help would be appreciated. Here's the error:
The error message at the top of the page indicates something odd has happened in the code, but doesn't give enough detail for anyone to suggest fixes.
If you turn on Debugging you will get a much more detailed error message, which should help someone to be able to fix your problem.
Turning on debugging gave the following info:
Notice: Undefined offset: 1 in /var/www/html/moodle/mod/assign/locallib.php on line 2994
Notice: Undefined offset: 1 in /var/www/html/moodle/mod/assign/locallib.php on line 6032
Error code: codingerror
- line 393 of /lib/setuplib.php: coding_exception thrown
- line 57 of /mod/assign/classes/event/grading_form_viewed.php: call to default_error_handler()
- line 3129 of /mod/assign/locallib.php: call to mod_assign\event\grading_form_viewed::create_from_user()
- line 526 of /mod/assign/locallib.php: call to assign->view_single_grade_page()
- line 53 of /mod/assign/view.php: call to assign->view()
Well, I can't say for certain what is going wrong, but it looks like it is failing to find the right userid to view when you click on the second user to grade.
When it looks for the user in the database, it doesn't find them, then the error message you got happens due to the 'user' being 'false' (database record not found) rather than an object containing the user details.
I can't really help much more than that - but it does look like a core Moodle bug to me - make sure you are running the very latest code (Moodle 2.9.2) and, if that doesn't solve your problem, you should open a ticket on tracker.moodle.org to see if someone can investigate further.