WeBWorK Main Forum

Bug trying to make grader in PGML problem give partial credit for wrong units.

Re: Bug trying to make grader in PGML problem give partial credit for wrong units.

by Geoff Goehle -
Number of replies: 0
I messed around with things for a bit, but there is kind of a fundamental issue. The NumberWithUnits parser you are using (http://webwork.maa.org/wiki/ProblemsWithUnits) allows students to use equivalent answers with different numbers (e.g. "12 in" or "1 ft"). They are set up to spit out an error message to the student if there isn't a unit attached to the number or if the unit given is incompatible with the correct answer unit because otherwise it is actually impossible to do the comparison. (After all *any* number would be correct with the "right" units.) So in some sense what you are asking for is impossible with NumberWithUnits.

You might be able to accomplish something similar with multiple answer blanks, or just a custom answer checker with some regexp parsing. But fundamentally any system which can reward the "right" answer without units also has to be very limited in the variety of units it can accept.