MDL-75947 ltiservice_gradebookservices: score->timestamp as dategraded

If this is not passed in to grade_update(), then it's not passed on to
update_raw_grade(), resulting in time() being used instead, which isn't
correct. The grade timemodified value should be set to the timestamp
provided by the tool in the score post JSON, not the time of the score
post itself.

Co-authored-by: Jayce Birrell <[email protected]>
This commit is contained in:
Jake Dallimore
2025-06-16 14:43:51 +09:30
committed by Jayce Birrell
co-authored by Jayce Birrell
parent 3dba1502c1
commit ba27489569
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -221,6 +221,12 @@ class grade_grade extends grade_object {
/** @var float $deductedmark mark deducted from final grade */
public float $deductedmark = 0;
/**
* Date when this grade was last graded.
* @var int $dategraded
*/
public $dategraded = null;
/**
* Returns array of grades for given grade_item+users
*
@@ -541,6 +541,7 @@ class gradebookservices extends service_base {
$grade->feedbackformat = $feedbackformat;
$grade->feedback = $feedback;
$grade->rawgrade = $finalgrade;
$grade->dategraded = $timemodified;
$status = grade_update($source, $gradeitem->courseid,
$gradeitem->itemtype, $gradeitem->itemmodule,
$gradeitem->iteminstance, $gradeitem->itemnumber, $grade);