DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserMultiAnswer.pl", ); Context("Vector"); # Context()->flags->set( promotePoints => 1 ); $v = Vector("<1,1,1>"); $zchk = MultiAnswer( $v, -$v )->with( singleResult => 0, # checkTypes => 0, checker => sub { my ( $cor, $stu, $self ) = @_; warn( "in checker" ); @ret = ( 0, 0 ); $ret[0] = ( $v->isParallel($stu->[0]) ); $ret[1] = ( $stu->[0] != $stu->[1] && $v->isParallel($stu->[1]) ); return [@ret]; } ); Context()->texStrings; BEGIN_TEXT Enter two vectors paralell to \(\vec v = $v\). $BR \( \vec z_1 = \) \{ $zchk->ans_rule(25) \} $BR \( \vec z_2 = \) \{ $zchk->ans_rule(25) \} END_TEXT Context()->normalStrings; ANS( $zchk->cmp() ); ENDDOCUMENT();
It appears that the checker is not checking student answers given as points (that is, (1,1,1)
instead of <1,1,1>
). I've tried adding the promotePoints
flag to the Context, as suggested by the commented out line, and setting checkTypes=>0
, also as suggested. However, with or without these when I enter an answer in point format the warn
in the checker doesn't fire, and I get the informational message "Your answer isn't a vector (it looks like a point)."
Any help clarifying why this is would be welcome. This is on WeBWorK 2.13, installed late August.
Thanks,
Gavin