Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-45009

Synchronizing grades doesn't work well when Tomcat language's decimal separator is a comma

    XMLWordPrintable

Details

    • Please Merge
    • Please Merge
    • Hide

      -Start Sakai in a tomcat configured with a locale having comma as decimal separator (spanish, french...)

      -Configure a LTI tool that can send grades to the Gradebook.

      -Create an assignment in the LTI tool and publish it.

      -Answer the assignment with a student so a grade is achieved (not 0).

      -As teacher, synchronize LTI tool with the Gradebook.

      -The grade should be correct.

      Show
      -Start Sakai in a tomcat configured with a locale having comma as decimal separator (spanish, french...) -Configure a LTI tool that can send grades to the Gradebook. -Create an assignment in the LTI tool and publish it. -Answer the assignment with a student so a grade is achieved (not 0). -As teacher, synchronize LTI tool with the Gradebook. -The grade should be correct.

    Description

      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.

      Gliffy Diagrams

        Zeplin

          Attachments

            Activity

              People

                daniel.merino Daniel Merino Echeverría
                daniel.merino Daniel Merino Echeverría
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Git Integration