MDL-33537 gradingform_rubric Adding the definition when retrieving grading instances

Credit to Sam Chaffee
This commit is contained in:
David Monllao 2012-07-20 14:56:00 +08:00
parent 3294034b80
commit 8fea05bfb4

View File

@ -556,7 +556,8 @@ class gradingform_rubric_controller extends gradingform_controller {
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 &&