## WeBWorK Problems

### decimal modification to Parser

by Alex Jordan -
Number of replies: 2
This may just be a question for Davide Cervone, but I'll post it here.

My idea is to add a post filter to answer checkers, where if the student gets an answer incorrect, and they have entered any decimal numbers as part of their submission, then they get a message alerting them of the error tolerance for decimals. The error message could be different for absolute or relative tolerance (or sigfig if we get around to that), and based on the value of the tolerance flag, and worded in a way that is friendlier to students than the ways we discuss this to ourselves.

What is a good way to implement this? Could it be done at the deepest level, as a modification to the base contexts? Or is that a bad idea, and it would need to be its own thing applied on a problem by problem basis?

### Re: decimal modification to Parser

by Davide Cervone -
I'm not sure that issuing such a message whenever there is a wrong answer is the right thing to do. I suspect it will more often be misleading than helpful, since many wrong answers are not due to improper precision, and after seeing it over and over for every incorrect answer, students will stop paying attention to it.

I suspect it is better to give it only when it is actually likely to be the source of their incorrect answer. But how to tell? It might be better to issue the message only if the answer is close but not close enough. Perhaps you could use twice the tolerance (or something like that) and see if the answer is within that before giving he message.

It is also not clear if you want this just for Real answers, or or all answer types. Doing this for Reals would not be too hard, but handling others would be more problematic. For example, with a Formula, some of the test points mint be OK and others would be outside the tolerances, so you'd have to go back through the points and see if any were close but not close enough. For things like vectors, you'd need to do this for each coordinate. (And for vector valued function, each coordinate of the answer at each test point.) It can get complicated.

An alternative might be to use the NumberCheck formula (like that one installed by the NoDecimals option) that would check the number of significant digits in any decimal the student enters and report a message if there are too few. That could be done fairly easily.