This is a fairly specific question about parserMultiAnswer.pl (see also the problem techniques page). I have a problem that is using this, and is checking six numeric answers. I'm finding that if someone enters an answer in one answer blank (the last, in particular) that isn't of numeric type the checker isn't being called even when I include checkTypes=>0
in the call to create the MultiAnswer object.
This is with the trunk version of WeBWorK, revision 6925, as well as revision 7044.
This is evident in the following very stripped down version of the problem as well.
DOCUMENT(); loadMacros( "PG.pl", "PGbasicmacros.pl", "PGanswermacros.pl", "MathObjects.pl", "parserMultiAnswer.pl", ); Context("Numeric"); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; @yvals = ( Compute(3.9625), Compute(0.0003) ); $mp = MultiAnswer( @yvals )->with( singleResult => 0, allowBlankAnswers => 1, checkTypes => 0, checker => sub { my ( $correct, $student, $self ) = @_; my @stu = @{$student}; my @cor = @{$correct}; return [ (ref($cor[0]) eq ref($stu[0]) && $cor[0] == $stu[0]), (ref($cor[1]) eq ref($stu[1]) && $cor[1] == $stu[1]) ]; } ); Context()->texStrings; BEGIN_TEXT Copy the values to the lower row: $BR \{ begintable(4) \} \{ row( @yvals ) \} \{ row( $mp->ans_rule(8), $mp->ans_rule(8) ) \} \{ endtable() \} END_TEXT Context()->normalStrings; ANS( $mp->cmp() ); COMMENT( 'Uses MathObjects' ); ENDDOCUMENT();
Am I missing something in how checkTypes
should be working? Is there something else that I'm missing here?
Thanks,
Gavin