Comma as decimal separator generating error.

Comma as decimal separator generating error.

by Mohammad kabir -
Number of replies: 6

Hi,

Moodle 3.2.1

When submit with answer like 22,33 then error page shows.

dot(.) ( for ex: 22.33) or whole number working well. We need to separate decimal or thousand by coma(,).

Is there any configuration issue... or anybody knows what to do? Thank you

Attachment number_coma_error.png
Attachment number_coma.png
Average of ratings: -
In reply to Mohammad kabir

Re: Comma as decimal separator generating error.

by Randy Thornton -
Picture of Documentation writers

Mohammad,

That actually works as expected.

The issue is that while the text on the page in the Lesson is Norwegian, the language of the site and of course is English. And part of the localization of the language is how numbers are formatted. So, the localization sees the comma as a violation, which it is for English.

If you set the language of the course to Norwegian instead of English, then the comma should be properly handled as correct for decimal numbers. (And a period would be incorrect. And if not, then that would be a bug in Lesson.)


Randy

In reply to Randy Thornton

Re: Comma as decimal separator generating error.

by Mohammad kabir -

Hi Randy,

Thanks for your nice answer. I set course language as Norwegian language( norsk-bokmål) ( see the pic ). Course admin-> edit settings->Appearance -> force language.  Still same error!  

Seems bug. If so, how to report? Thanks once again.

Attachment course_lang.png
Attachment course_settings.png
In reply to Mohammad kabir

Re: Comma as decimal separator generating error.

by Randy Thornton -
Picture of Documentation writers


I suspected that might be the case. Looks like a bug.

You can search in the Tracker https://tracker.moodle.org/secure/Dashboard.jspa for open issues with Lesson and see if anyone has reported it yet. If not, then feel free to report it.

In reply to Randy Thornton

Re: Comma as decimal separator generating error.

by Mohammad kabir -

Hi,

It's not easy to report a bug.  Don't know how to solve it. How to give you demo?

 

Attachment track.png
In reply to Mohammad kabir

Re: Comma as decimal separator generating error.

by Mohammad kabir -

Hi,

I can't report a bug.  Don't know how to demonstrate here.  If anybody can report above bug for me.

Thank you.

In reply to Mohammad kabir

Re: Comma as decimal separator generating error.

by Randy Thornton -
Picture of Documentation writers

Mohammed,

First, you get that message because the system will not allow you to post a new item until you have search for any existing items. You may not be the first person to have this problem; a ticker may already exist about this problem, and you should add to it rather than start a new one.

After searching, if you do not find anything related to this issue, either in Lesson or for other tools like Quiz or Gradebook that could have this problem, then create a new issue.

You only need to put three things: 

1) The version of Moodle this happens on and what the exact error message is. Exact wording of the error is important.


2) The steps to reproduce the issue. For the steps, just put in the steps that you take to create what is happening, so someone can reproduce the issue.

So, the steps would be something like:

  • Check that the language of the site is English
  • Create a new Lesson,
  • Add a Question type page to the Lesson
  • Add a question of a certain type 
  • Add answers of a certain type and save it.
  • Preview or log in as student and type the Lesson and enter in - see the results
  • Switch the course language to one which users commas as decimal seperator
  • Test again as student and enter a comma and see the error


3) State what you expect to happen. In this case, the expected behavior is that when the course language uses a comma as a decimal separator, then it should function normally and not give an error.


That's all there is to any good ticker. The steps are key. Someone on the dev team must be able to reproduce this problem using your steps. If they can't, they will not start working on it right away (or maybe ever).  


Randy