########################################################## # # Example showing how to use the built-in answer checker for parsed values. # DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "Parser.pl", ); TEXT(beginproblem()); ########################################################## # # The setup # Context('Vector'); $P1 = Point(-2,4,2); $P2 = Point(2,-3,1); $M = ($P1+$P2)/2; ########################################################## # # The problem text # Context()->texStrings; BEGIN_TEXT The midpoint of the line segment from \($P1\) to \($P2\) is \{ans_rule(20)\}. END_TEXT Context()->normalStrings; ########################################################### # # The answer # ANS($M->cmp); ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.