display values rounded off

display values rounded off

by Lau Yan Chun 劉昕雋 老師 -
Number of replies: 2

I am recently trying to design calculated questions to students on the topic of significant figures. What I found out is in feedback text, I cannot display a value calculated with variables (saying, {a}), correct to specific significant figures. As the value is not the final answer, the setting in answer option is not related in this situation.

Example:

let {a} be 59

the final answer is prefered to be (59/60), correct to 3 significant figures and I attempt to show value{59/60, correct to 3 significant figures} in the feedback text.


Any suggestion for this kind of situation? same issue in dealing with the decimal places.

Thanks!

Average of ratings: -
In reply to Lau Yan Chun 劉昕雋 老師

Re: display values rounded off

by Jean-Michel Védrine -

I don't know if this is possible with the core calculated question but this is possible with the Formulas question type latest version with the sigfig function.

if you put a=59; in the Global variables field of your question then including {=sigfig(a/60,3)} in the General feedback (or anywhere else) will display the expected value.

Note: As the sigfig fnction  is a recent addition, despite I have included phpUnit tests to verify that it is working, if you find that the result for some number/significant figures combinations is not what you expect, don't hesitate to post a bug report.