Permalink
Browse files

MDL-33537 gradingform_rubric Adding the definition when retrieving gr…

…ading instances

Credit to Sam Chaffee
  • Loading branch information...
1 parent 947ba9c commit 2322b97e389e9ab427e10903461fd5e40621063f @dmonllao dmonllao committed Jul 20, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 grade/grading/form/rubric/lib.php
@@ -556,7 +556,8 @@ public function get_or_create_instance($instanceid, $raterid, $itemid) {
return $this->get_instance($instance);
}
if ($itemid && $raterid) {
- if ($rs = $DB->get_records('grading_instances', array('raterid' => $raterid, 'itemid' => $itemid), 'timemodified DESC', '*', 0, 1)) {
+ $params = array('definitionid' => $this->definition->id, 'raterid' => $raterid, 'itemid' => $itemid);
+ if ($rs = $DB->get_records('grading_instances', $params, 'timemodified DESC', '*', 0, 1)) {
$record = reset($rs);
$currentinstance = $this->get_current_instance($raterid, $itemid);
if ($record->status == gradingform_rubric_instance::INSTANCE_STATUS_INCOMPLETE &&

0 comments on commit 2322b97

Please sign in to comment.