We have a unique issue where only 1 of our users (System Admin role) is getting an error when trying to 'View all submissions' on a course. Tried multiple other users and this action works as expected. Permissions for mod/assign look identical for this user as other users who do not get the error. Any thoughts?
Url - /mod/assign/view.php?id=9641&action=grading
(when clicking the view all submissions button below)
The next page throws the below error for them. (Note - also on this page where the error is thrown, all CSS / theme / images etc are gone)
Debug info:
Coding error detected, it must be fixed by a programmer: Improper use of the assignment class. Cannot load the grade item.
Debug info:
Error code: codingerror
Stack trace:
line 1438 of /mod/assign/locallib.php: coding_exception thrown
line 265 of /mod/assign/gradingtable.php: call to assign->get_grade_item()
line 4135 of /mod/assign/locallib.php: call to assign_grading_table->__construct()
line 4214 of /mod/assign/locallib.php: call to assign->view_grading_table()
line 589 of /mod/assign/locallib.php: call to assign->view_grading_page()
line 55 of /mod/assign/view.php: call to assign->view()
This appears to be the code that is throwing the error, i'm just not sure why for this user it's not able to create this grade item?
public function get_grade_item() {
if ($this->gradeitem) {
return $this->gradeitem;
}
$instance = $this->get_instance();
$params = array('itemtype' => 'mod',
'itemmodule' => 'assign',
'iteminstance' => $instance->id,
'courseid' => $instance->course,
'itemnumber' => 0);
$this->gradeitem = grade_item::fetch($params);
if (!$this->gradeitem) {
throw new coding_exception('Improper use of the assignment class. ' .
'Cannot load the grade item.');
}
return $this->gradeitem;
}