MDL-67132 mod_lti: document new param

(amended to move the upgrade.txt info to correct 3.7.5)
This commit is contained in:
Claude Vervoort
2020-02-26 17:29:21 +01:00
committed by Eloy Lafuente (stronk7)
parent dc39cee4f9
commit b3172cc0fd
3 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -1721,6 +1721,7 @@ class grade_item extends grade_object {
* @param string $feedback Optional teacher feedback
* @param int $feedbackformat A format like FORMAT_PLAIN or FORMAT_HTML
* @param int $usermodified The ID of the user making the modification
* @param int $timemodified Optional parameter to set the time modified, if not present current time.
* @return bool success
*/
public function update_final_grade($userid, $finalgrade = false,
@@ -1793,7 +1794,7 @@ class grade_item extends grade_object {
$gradechanged = false;
if (empty($grade->id)) {
$grade->timecreated = null; // Hack alert - date submitted - no submission yet.
$grade->timemodified = $timemodified ?: time(); // Hack alert - date graded.
$grade->timemodified = $timemodified ?? time(); // Hack alert - date graded.
$result = (bool)$grade->insert($source);
// If the grade insert was successful and the final grade was not null then trigger a user_graded event.
@@ -1817,7 +1818,7 @@ class grade_item extends grade_object {
return $result;
}
$grade->timemodified = $timemodified?:time(); // Hack alert - date graded.
$grade->timemodified = $timemodified ?? time(); // Hack alert - date graded.
$result = $grade->update($source);
// If the grade update was successful and the actual grade has changed then trigger a user_graded event.
+3
View File
@@ -1,6 +1,9 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 3.7.5 ===
* grade_item::update_final_grade() can now take an optional parameter to set the grade->timemodified. If not present the current time will carry on being used.
=== 3.7.4 ===
* behat_data_generators::the_following_exist() has been removed, please use
behat_data_generators::the_following_entities_exist() instead. See MDL-67691 for more info.
@@ -394,7 +394,7 @@ class gradebookservices extends service_base {
$grade->feedbackformat = $feedbackformat;
$grade->feedback = $feedback;
$grade->rawgrade = $finalgrade;
$status = \grade_update($source, $gradeitem->courseid,
$status = grade_update($source, $gradeitem->courseid,
$gradeitem->itemtype, $gradeitem->itemmodule,
$gradeitem->iteminstance, $gradeitem->itemnumber,
$grade);