LTI 1.3 Synchronizing grades doesn't work well when Tomcat language's decimal separator is a comma
GENERAL
TESTING
GENERAL
TESTING
Description
is related to
Activity
Show:
Automation for Jira October 18, 2024 at 8:35 AM
A pull request has been created, "SAK-50616 LTI 1.3 Synchronizing grades doesn't work well when Tomcat language's decimal separator is a comma", you can see it at https://github.com/sakaiproject/sakai/pull/12971
Jesus Maria Mendez Perez October 18, 2024 at 8:12 AM
Same solution than https://sakaiproject.atlassian.net/browse/SAK-45009 also applied on LTI1.3 method
Fixed
Details
Details
Priority
Affects versions
Fix versions
21 Status
Merged
Components
Assignee
Jesus Maria Mendez Perez
Jesus Maria Mendez PerezReporter
Jesus Maria Mendez Perez
Jesus Maria Mendez PerezCreated October 18, 2024 at 8:10 AM
Updated February 27, 2025 at 4:33 PM
Resolved October 21, 2024 at 6:42 AM
We have experienced this issue testing the platforms H5P and Wooclap via LTI integration.
When grades are synchronized with Gradebook the grade is only correctly written in Gradebook if Tomcat's locale has the point as decimal separator. If Tomcat's locale has the comma as decimal separator (i.e. in spanish, french...) the grades are multiplied by 10 (because points are ignored and 1.0 is changed by 10)
I have applied a fix copied from Gradebook's code and it works. It's just adding this code in SakaiBLTIUtil.java in getRoundedGrade() method:
String gradeI18n = String.valueOf(theGrade); FormattedText formattedText = ComponentManager.get(FormattedText.class); if (",".equals(formattedText.getDecimalSeparator())) gradeI18n = gradeI18n.replace(".",","); return gradeI18n;
This works in my test server with spanish and US english locales.
Before doing a PR I would like to know if this solution is acceptable.