WeBWorK Main Forum

Number of digits in "Entered" box

Number of digits in "Entered" box

by Stefania Tracogna -
Number of replies: 2
How can I change the number of significant digits displayed in the
"Entered" box when a student checks his answer?
I have multiple parts problems where the student enters a formula
for part (a), webwork evaluates the formula, but displays only six
significant digits instead of the seven the student needs to find
the correct answer for part (b).

I tried adding format=>'%0.7f#' to the answer evaluator but
that changed only the way the formula is displayed in the Answer
Preview and not the number of digits displayed in "Entered" after
the formula is evaluated.

Thank you
In reply to Stefania Tracogna

Re: Number of digits in "Entered" box

by Darwyn Cook -
I have written an epsilon/delta problem where the student can control the size of the graph, by doing this they need to find delta to within 0.000003 digits of accuracy (a tolerance I am working on through experiment). There are four input boxes to control the xmin, xmax, ymin, and ymax and an input box for their answer. I wanted each of these boxes to display at least eight digits of accuracy.
I used math objects, and put
Context()->{format}{number} = "%.8g";
at the top of the problem code.

I put the answer tolerance in the answer:
$delta = Real(abs($epsilon/$m))->with(
tolType=>'absolute', tolerance=>'0.000003');

I typed .00295+0.0000003 for an answer, after submitting this answer "Entered" contained 0.0029503, while the input box still contained .00295+0.0000003. So that might do what you want.