-
Bug
-
Resolution: Fixed
-
Critical
-
2.2
-
MOODLE_22_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
MDL-33537_master -
While working on using advanced grading methods for another activity I discovered some inconsistencies when grading with rubric. Sometimes activities for user that had been graded wouldn't properly load the graded rubric (it would load a blank rubric) and sometimes activities that hadn't been graded would load a partially filled rubric.
I tracked it down to the gradingform_rubric_controller's get_or_create_instance($instanceid, $raterid, $itemid) method. When $instanceid is 0 and $raterid and $itemid are not, this query gets executed:
if ($rs = $DB->get_records('grading_instances', array('raterid' => $raterid, 'itemid' => $itemid), 'timemodified DESC', '*', 0, 1)) {
|
With only one type of activity being used with advanced grading (assignment submissions) this is not a problem because $itemid is guaranteed to be unique because it is an assignment submission id. But with multiple activities being used there may be multiple $itemids that are the same, but do not represent the same activity.
I believe this issue is simply addressed by adding the definitionid as a parameter to the query:
if ($rs = $DB->get_records('grading_instances', array('definitionid' => $this->definition->id, 'raterid' => $raterid, 'itemid' => $itemid), 'timemodified DESC', '*', 0, 1)) {
|