-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Please review the following line:
moodle-local_ltiprovider/lib.php
Line 360 in e70e4b9
| if ( intval($grade) == $user->lastgrade ) { |
Should the above code be an exact check and then we store the exact grade being sent in the db?
Use Case
- A quiz is worth 10 points.
- Student gets a 9.2 on their first attempt.
- Cron script runs, sends the float value and then sets the last-grade to 9 in the db.
- Student gets a 9.8 on their second attempt.
- Cron script runs and does not send the float value, because the check in the code referenced above considers 9.2 and 9.8 as the same.
Or at the very least could we round the grade and check that way?
$roundedGrade = round($grade);
if (intval($roundedGrade) == $user->lastgrade) {
continue;
}And then store the rounded grade instead.
$DB->set_field('local_ltiprovider_user', 'lastgrade', intval($roundedGrade), array('id' => $user->id));This solution still does not provide an exact check. 9.2 and 9.3 would still be see as 9. But I believe it would be a little more accurate.
Metadata
Metadata
Assignees
Labels
No labels