MDL-86437 enrol_lti: Cast scoreGiven to float for LTI compliance

scoreGiven was being passed as a string (e.g. "8.0"), which caused
validation errors in some LMS implementations such as Rustici Engine.
According to the LTI specification, scoreGiven must be numeric if
present.

Co-authored-by: Jake Dallimore <[email protected]>
This commit is contained in:
fgo
2026-01-29 14:58:43 +08:00
committed by Jake Dallimore
co-authored by Jake Dallimore
parent 96dd901bea
commit 65da222994
@@ -122,6 +122,7 @@ class sync_tool_grades extends adhoc_task {
mtrace("Skipping - Invalid grade $mtracecontent.");
continue;
}
$grade = floatval($grade); // Grade must be sent as a numeric value, not a string.
if (empty($grademax)) {
mtrace("Skipping - Invalid grademax $mtracecontent.");