return true;
}
+ /**
+ * Mark in the database that this grade record should have an update notification sent by cron.
+ *
+ * @param stdClass $grade a grade record keyed on id
+ * @return bool true for success
+ */
+ public function notify_grade_modified($grade) {
+ global $DB;
+
+ $grade->timemodified = time();
+ if ($grade->mailed != 1) {
+ $grade->mailed = 0;
+ }
+
+ return $DB->update_record('assign_grades', $grade);
+ }
+
/**
- * Update a grade in the grade table for the assignment and in the gradebook
+ * Update a grade in the grade table for the assignment and in the gradebook.
*
* @param stdClass $grade a grade record keyed on id
* @return bool true for success
}
$this->update_grade($grade);
+ $this->notify_grade_modified($grade);
- // save outcomes
+ // Save outcomes.
if ($CFG->enableoutcomes) {
$data = array();
foreach ($modified->gradinginfo->outcomes as $outcomeid => $outcome) {