Decimal character problem with Embedded Cloze question

Decimal character problem with Embedded Cloze question

by Peter Diedrichs -
Number of replies: 4
Picture of Particularly helpful Moodlers

I have a formula in an embedded cloze question, using point for decimal character:

{2:NUMERICAL:=23.8:0.1~%100% 23.8~%50%23.8:2}

I have also used comma for decimal character:

{2:NUMERICAL:=23,8:0,1~%100% 23,8~%50%23,8:2}

Both variants actually work - but the answer must, in both cases, be given with a decimal comma. 
Otherwise I get an error message that the answer must be completed.
Is this expected behaviour?
Average of ratings: -
In reply to Peter Diedrichs

Re: Decimal character problem with Embedded Cloze question

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I would expect the behaviour in Cloze should be the same as a stand-alone numerical question.

However, I am not sure what Cloze question parsing will make of the commas ... [looks at code] ... Hmm. parsing seems OK, but saving the numerical subuestion might not be.
In reply to Tim Hunt

Re: Decimal character problem with Embedded Cloze question

by Peter Diedrichs -
Picture of Particularly helpful Moodlers
Hi Tim. I did a thorough test both as teacher (a preview) and as a student (attempt) and it seem to be that the problem is in the preview.

I made two questions, in the same quiz, one using comma and one using period in the formula.

As a student doing the quiz and using comma in both answers, it looked like this the first attempt:





But, the next attempt also using comma in the answers looked like this:





When using period in both answers:




When previewing the quiz as a teacher using comma in both answers, it looked like this:




When previewing the quiz as a teacher using period in both answers, it looked like this:




But there really is some kind of inconsistency, as you can see from the first image, where comma was used by the student and it still worked, but only the first attempt
We have this inconsistency also in the teacher previews, but as it is an inconsistency I haven't managed to get it all captured... 

My tests all started due to strange behaviour / inconsistency in the teacher preview.
In reply to Peter Diedrichs

Re: Decimal character problem with Embedded Cloze question

by Peter Diedrichs -
Picture of Particularly helpful Moodlers
Should add: Yesterday, when first investigating this in the teacher preview, I came to the opposite conclusion - that the answer always worked only when using comma in the answer. Today period "rules". So the problem is inconsistent, indeed.

Just a thought: Could this somehow have anything to do with server localisation settings (since we are in Sweden (where comma is used for decimals)? Perhaps in combination with any mismatch between server nodes, hence the inconsistency?
In reply to Peter Diedrichs

Re: Decimal character problem with Embedded Cloze question

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't know. Your findings currently have me completely puzzled. I don't understand how that is happening, but clearly it is.