moodle-qtype_formulas icon indicating copy to clipboard operation
moodle-qtype_formulas copied to clipboard

Detect locale settings for automatic setting of decimal separator

Open mijenner opened this issue 1 year ago • 4 comments

Description of proposed feature

According to documentation on dynamiccourseware a javascript has to be added to enable Formulas correct handling of decimal separator if it isn't point separator (but the alternative comma separator).

Proposal is to integrate this functionality into the system so that it can be controlled through one Moodle settings (Site administration -> Language -> Language Settings) and let Formulas detect what locale the rest of Moodle is using and adapt accordingly.

How can the new feature be used?

It will ease installation and possibly adaption of the plugin.

Additional comments

Great plugin which in my opinion should be core of Moodles quiz system.

mijenner avatar Jun 21 '24 06:06 mijenner

Thanks for your suggestion. Please also see this comment: https://github.com/FormulasQuestion/moodle-qtype_formulas/issues/11#issuecomment-1826836852

PhilippImhof avatar Jun 21 '24 06:06 PhilippImhof

As always, I have to emphasise that this is not simply a localisation issue. Some input fields allow entering more than just numbers and the comma has a very specific meaning in those cases. I fundamentally oppose to any solution that would lead to different handling of the various answer types, because in extreme cases, students would be able to use the comma in one part of a question, but not in another one.

For now, people just have to remember one single thing: never use the comma as a decimal separator with Formulas question. While that might go against their local usage, it is easy enough to remember. And I still find it acceptable in the sense that we also have to use a point with Wolfram Alpha, SageMath, Maple, Mathlab or all programming languages. Also, all calculators I have ever seen use a "." button for the decimal separator, even those sold in e.g. Germany.

PhilippImhof avatar Jun 21 '24 06:06 PhilippImhof

Noted. Same goes for Geogebra.

mijenner avatar Jun 21 '24 06:06 mijenner

Also, I will of course keep in mind your suggestion when trying to implement the solution described in the linked comment, e. g. by only considering the comma, if it is a valid decimal separator according to the student's language setting.

PhilippImhof avatar Jun 21 '24 07:06 PhilippImhof

Hello @mijenner

As you might have seen in #228, I am currently implementing localised number formatting. However, the locale setting will not be taken into account for entry of results. Instead, the comma and the decimal point will both be accepted for all locales. The reason behind that is that grading or re-grading might be done by someone with a different locale than the student.

PhilippImhof avatar Jun 09 '25 09:06 PhilippImhof