## WeBWorK Problems

### Re: ambiguous unit --- how/need to handle ?

by Gavin LaRose -
Number of replies: 0
Hi Dick,

It's actually worse than this. I think it's not actually managing to do any meaningful check of units (that is, it appears that whatever one puts in is marked correct—lb, lb/day, etc.). The checker is

ANS(String("cal")->cmp( checker=>sub {
my ( $cor,$student, $ansHash ) = @_; return NumberWithUnits( 1,$cor ) ==
NumberWithUnits( 1, \$student );
} ) );


After some poking, I think the problem is somewhere in the interaction between the NumberWithUnits comparison embedded in a String object. I can construct NumberWithUnits objects in a checker for a NumberWithUnits that do what I expect, but when I start with a String it's not figuring out what's going on correctly.

I'll have to look at this more to get a better understanding of where the problem is creeping in, but it appears to be farther into the internals of MathObjects.

Gavin