Skip to content
Browse files

fixed bug that appeared when teacher grades student with a rubric for…

… the first time
  • Loading branch information...
1 parent bb50c37 commit 050125d47eed646ba8fbe83054cd8f059c1c3139 @marinaglancy marinaglancy 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
@@ -504,7 +504,8 @@ public function get_or_create_instance($instanceid, $raterid, $itemid) {
if ($rs = $DB->get_records('grading_instances', array('raterid' => $raterid, 'itemid' => $itemid), 'timemodified DESC', '*', 0, 1)) {
$record = reset($rs);
$currentinstance = $this->get_current_instance($raterid, $itemid);
- if ($record->status == gradingform_rubric_instance::INSTANCE_STATUS_INCOMPLETE && $record->timemodified > $currentinstance->get_data('timemodified')) {
+ if ($record->status == gradingform_rubric_instance::INSTANCE_STATUS_INCOMPLETE &&
+ (!$currentinstance || $record->timemodified > $currentinstance->get_data('timemodified'))) {
$record->isrestored = true;
return $this->get_instance($record);
}

0 comments on commit 050125d

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