WeBWorK Main Forum

more.... appropriate precision

Re: more.... appropriate precision

by Michael Gage -
Number of replies: 0

Do you want an algorithm like this?

Do a numerical match of the students answer. Fail unless this matches.

Then take the students string e.g. 2.834 or 2.800 or 2.8 and
truncate the decimals 1 decimal digit (to 2.8 in all cases) and compare this with the original answer -- you get a fail unless they match.

I think you can do this with withPostFilter()

see customAnswer.pl and answerHints.pl in the POD link in the author section on the wiki.

Good luck -- let us know what works -- you can put up a sample in the Problem Techniques section of the wiki.