cancel
Showing results for 
Search instead for 
Did you mean: 
jsmee
Surveyor

Display trailing zeros in quiz variables?

When setting up a formula equation I have a variable set up that needs to have one decimal place. However if the range of the variable includes an integer number (e.g. 19.4 to 20.6 where 20.0 is possible) then only the integer value (20) is shown instead of what I intended to display (20.0) if that happens to be one of the number generated. This creates a HUGE problem when dealing with significant figures because 20 has 1 significant figure while 20.0 has 3. I have students getting penalized for rounding to fewer significant digits that what they should (e.g. 1 instead of 3) because they followed the rules properly. If an integer value is possible then why even have the option to allow decimal places if trailing zeros are always omitted from integers? Anybody know of workarounds? (Aside from not setting ranges that have integer numbers in them or constantly generating possible answers until you get a set that are not problematic.)

4 Replies
malini_rao4
Surveyor

I have the same issue and am hoping someone on this board will help.

James
Navigator II

jsmee,  @malini_rao4 

Is this still an issue? When I went in to test it today, Canvas was providing me with the .0 at the end.

307604_pastedImage_2.png

This is despite it showing a whole number in the variable definitions section

307605_pastedImage_3.png

And in the generated values

307606_pastedImage_4.png

If the problem still persists, can you see if editing and updating the question helps?

Canvas saves the values when you update the question in the quiz editor, not when the question is displayed. If it's saved incorrectly, it might need updated to register the correct number of decimals.

I looked at what the browser is sending to the server and it's sending the server the integer values.

307607_pastedImage_6.png

But the server is returning the question with the one decimal point.

"answers":[  
{
"weight":100,
"variables":[
{
"name":"x",
"value":"4.0"
}
],
"answer":4.0,
"id":"1327"
},

That is why I don't think you'll need to regenerate the values, just edit and update the question.

I suspect that it was the code that formatted the numbers and that it got applied when it shouldn't have been, but the underlying variables were saved properly. If that's the case, you may not need to do anything other than check that it's working correctly. The suggestion to edit and update the questions is only if it's still not working properly.

chofer
Community Coach
Community Coach

Hello there, jsmee and  @malini_rao4  ...

I have been reviewing older questions here in the Canvas Community, and I stumbled upon this question.  I wanted to check in with both of you because I noticed that we haven't heard back from either of you in quite a while.  It looks like  @James  was able to chime in back on March 3, 2019.  Have you both had a chance to review his feedback?  And Jason, since you were the one who originally asked the question, do you feel that James has answered your question?  If so, please feel free to mark it as "Correct".  But, if you are still looking for some help from members of the Community, please come back to this topic to provide an update for us so that someone might be able to help you out.  For the time being, I am going to mark your question as "Assumed Answered" because we've not heard back from either of you and because there hasn't been any new activity in this topic for a couple months.  However, that will not prevent you or others from posting additional questions and/or comments below that are related to this topic.  I hope that's alright with you, Jason and Malini.  Looking forward to hearing back from you soon.

kstewart4
Surveyor

This problem hasn't been resolved.  James actually demonstrated the problem.  When he put in the request for a variable with one decimal place, it shows up as 4  .  It should be showing up as 4.0 .  That is a big difference in a science question!