DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "draggableProof.pl", "answerCustom.pl" ); ############################################################## # SETUP ############################################################## Context("Numeric"); $proof = DraggableProof( [ "\( 1 \leq 2 \)", "\( 2 \leq 3 \)", "The relation \(\leq\) is transitive", "\( 1 \leq 3 \)", ], [ "irrelevant statement" ] ); ############################################################## # QUESTION TEXT ############################################################## # Print problem number and point value (weight) for the problem TEXT(beginproblem()); Context()->texStrings; BEGIN_TEXT \{ $proof->Print \} END_TEXT Context()->normalStrings; ############################################################## # ANSWERS ############################################################## # Attempt at testing custom answer checkers for draggable proofs # Expected behaviour: any answer should be marked correct # Actual behaviour: only the answer specified in the definition # of $proof is marked correct ANS( $proof->cmp( checker=>sub { my ($correct, $student,$ans) = @_; return 1; } )); # Another attempt using answerCustom.pl # See: https://webwork.maa.org/pod/pg/macros/answerCustom.html # Also doesn't work # ANS(custom_cmp("0",sub { # my ($correct,$student,$ans) = @_; # return 1; # }, sameClass=>0, sameLength=>0) #); ENDDOCUMENT();