Skip to content

Commit

Permalink
MDL-61324 enrol_lti: fix detection of changed grades during sync
Browse files Browse the repository at this point in the history
  • Loading branch information
davosmith committed Feb 12, 2018
1 parent 315a0a3 commit 8037f32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions enrol/lti/classes/task/sync_grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ public function execute() {
continue;
}

// This can happen if the sync process has an unexpected error.
if ($grade == $ltiuser->lastgrade) {
// Check to see if the grade has changed.
if (!grade_floats_different($grade, $ltiuser->lastgrade)) {
mtrace("Not sent - The grade $mtracecontent was not sent as the grades are the same.");
continue;
}
Expand All @@ -174,7 +174,7 @@ public function execute() {
}

if (strpos(strtolower($response), 'success') !== false) {
$DB->set_field('enrol_lti_users', 'lastgrade', intval($grade), array('id' => $ltiuser->id));
$DB->set_field('enrol_lti_users', 'lastgrade', grade_floatval($grade), array('id' => $ltiuser->id));
mtrace("Success - The grade '$floatgrade' $mtracecontent was sent.");
$sendcount = $sendcount + 1;
} else {
Expand Down

0 comments on commit 8037f32

Please sign in to comment.