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:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user