$value) { $this->$param = $value; } return $this; } else { $grade_history = new grade_history($grade_history); return $grade_history; } } else { return false; } } /** * Given a grade_grades_raw object and some other parameters, records the * change of grade value for this object, and associated data. * @static * @param object $grade_raw * @param float $oldgrade * @param string $note * @param string $howmodified * @return boolean Success or Failure */ function insert_change($grade_raw, $oldgrade, $howmodified='manual', $note=NULL) { global $USER; $history = new grade_history(); $history->itemid = $grade_raw->itemid; $history->userid = $grade_raw->userid; $history->oldgrade = $oldgrade; $history->newgrade = $grade_raw->gradevalue; $history->note = $note; $history->howmodified = $howmodified; $history->timemodified = mktime(); $history->usermodified = $USER->id; return $history->insert(); } } ?>