From ef11603e5816a1539f730b19765b297e2011ce18 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Fri, 9 Aug 2024 13:55:43 +0800 Subject: [PATCH] MDL-75947 ltiservice_gradebookservices: use 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. --- .../classes/local/service/gradebookservices.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php b/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php index 55b6e623e11d9..50f211bf2f7dd 100644 --- a/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php +++ b/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php @@ -541,6 +541,7 @@ public function save_grade_item($gradeitem, $score, $userid) { $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);