WeBWorK Problems

Display of student input with significant figures

Re: Display of student input with significant figures

by Steven Fiedler -
Number of replies: 0

I'm resurrecting this thread.  Davide's approach on this has worked quite well but I believe there is an edge case that requires some attention.  If a student answer has the same number of decimal places as the correct answer and is within the tolerance of the correct answer, then it should be credit as correct.  However, if the two values yield slightly different strings, i.e. 1005.20 and 1005.00, the algorithm will flag it as having an incorrect number of sig figs.

I attempted to call another routine within cmp_postprocess to compare the number of sig figs of both the student answer and correct answer, but it does not appear that such a routine is within the scope cmp_postprocess.  I would appreciate any thoughts on circumventing such limitations.