LTI 1.1 grading not working for some locales
Bug #2004852 reported by
Marie-Eve Lévesque
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Mahara | ||||||
21.10 |
Fix Released
|
High
|
Unassigned | |||
22.04 |
Fix Released
|
High
|
Unassigned | |||
22.10 |
Fix Released
|
High
|
Unassigned | |||
23.04 |
Fix Released
|
High
|
Unassigned |
Bug Description
With a LTI to a Moodle instance, when the teachers grades a submission, the grade is not sent to Moodle in some cases. I think it has to do with my server's locale set to french. The grade of 94%, for example, si translated to 0,94 instead of 0.94.
I printed some debug and was able to see the error "Score must be numeric". I also printed the xml from the $body variable (see attachment).
I made a few changes in function publish_lti_outcome of htdocs/
$grade = $this->grade / 100;
$grade = str_replace(',', '.', $grade);
$smarty-
This was tested with Mahara 22.10 and Moodle 3.11.
Changed in mahara: | |
milestone: | 23.04.0 → none |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
no longer affects: | mahara |
To post a comment you must log in.
Thank you for the report, Marie-Eve. We'll review your suggestion and put it through our code review system.
Note for testing: This would be for LTI 1.1, using the 'External tool' option in Moodle.