Skip to content
Browse files

MDL-33537 gradingform_rubric Adding the definition when retrieving gr…

…ading instances

Credit to Sam Chaffee
  • Loading branch information...
1 parent 3294034 commit 8fea05bfb432b19d198c240229b53f7e52f55498 @dmonllao dmonllao committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 grade/grading/form/rubric/lib.php
View
3 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 8fea05b

Please sign in to comment.
Something went wrong with that request. Please try again.