Decimals don't seem to work in formula questions i quiz.

Jump to solution
Community Participant

Why is this wrong?

I have no margin of error, but it shouldn't be nescessary either, as it is the exact same number.

What is happening?

It started out as only making the error for rewriting 30 % to 0,3 since I have it set to give an answer with two decimals, but now it is just wrong everytime I make a question, that involves decimals.

I tried adding a margin of error, which was completely ignored.

What to do?



1 Solution
Community Champion

 @lic ,

This sounds like an issue that Canvas had earlier but was supposedly resolved. I hope it hasn't popped back up.

Someone else had a similar issue earlier this month: period - comma problem . Someone marked my answer as correct without any response back from the original person, but based on your comments -- that response might not have been the correct response.

It appears that your institution is hosted by Instructure (based off the link at the bottom of this page VUC Storstrøm | Tilmeld dig nu - studiestart januar 2019 - VUC Storstrøm ). If your college or department was hosting the open-source version of Canvas, it might be possible that they had an older version and need to upgrade to get the fixes. However, I'm able to duplicate your issue and we're using the Instructure hosted version, so it's currently a bug that doesn't affect us directly since we use a period as a decimal separator.

Here's some of the history. Earlier this year, Canvas decided that they would support internationalization of numbers so that people who used a , as a decimal could enter values that way, while those who used a . as a decimal could enter it that way. It was a great idea, but the implementation was flawed.

When Canvas did this, they broke some things. Noticeably, during that time (I think it was end of July / beginning of August), formula questions that were generated with any type of precision were getting the answers stored as 0. Here are messages related to that issue: Problem with formula question  and Why does my formula keep returning 0? . It was supposed to have been fixed on July 25, 2019. If the questions were created in July 2019, you can check if this is the issue in two ways -- (1) edit the question and see if all of the responses are 0 or (2) enter 0 for the answer and see if it's accepted as correct.

A second issue was what the problem was trying to fix -- the ability to use the natural decimal separator for your language. When I search the community, I find several issues related to using a comma as a decimal. They appear in different places: quizzes, SpeedGrader, etc., and most of them were around December 2018, but it's entirely possible that bugs get reintroduced.

Issue 1:

It sounds like you are creating the problems now, rather than back in July, so it may be that the bug has been re-introduced.  I did test some things. Canvas is sending the questions correctly to the server. This means that the specific problem I mentioned above is not the issue. When I take the quiz with a period as a decimal, it works correctly.

This rules out issue 1 for newly created questions. 

Issue 2:

If I try to enter a comma as a decimal (with my language set to US English), I get a note that only numerical values are accepted and it converts 0,14 to 14 as the answer.


I switched my language to Dansk and am seeing what you're seeing.

When I try a period decimal, it treats it like a comma in US English and gives me 174, which is wrong.


When I use a comma as a period, it gives the wrong answer.



I also created a new question while my language was set to Dansk and it was properly generated in the browser and delivered to Canvas. It experienced the same issue, what you enter is exactly what Canvas is looking for, but it is counted wrong.

That suggests there is a problem with the way that Canvas parses the student responses. The text that is sent back to Canvas when a student responds is as they typed it: 0,24 and not the way that Canvas would understand it 0.24.

I would report this as a bug to Canvas.

View solution in original post