########################################################### # # Example showing how to use the Parser's function # answer checker. # DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PGbasicmacros.pl", "PGanswermacros.pl", "Parser.pl", "parserUtils.pl", ); TEXT(beginproblem()); ########################################################### # # The setup # Context('Vector')->variables->are(x=>'Real',y=>'Real'); $x = Formula('x'); $y = Formula('y'); $a = random(1,16,1); $b = non_zero_random(-5,5,1); $f = ($x**2 + $a*$y**2 + $b*$x**2*$y) -> reduce; $x = sqrt(2*$a)/$b; $y = -1/$b; ########################################################### # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose \(f(x,y) = $f\). $PAR Then \(f\) has critical points at the following points: \{ans_rule(30)\}. $PAR ${BCENTER} ${BSMALL} To enter more than one point, separate them by commas.$BR Enter ${LQ}${BTT}NONE${ETT}${RQ} if there are none. ${ESMALL} ${ECENTER} END_TEXT Context()->normalStrings; ########################################################### # # The answers # ANS(List(Point(0,0),Point($x,$y),Point(-$x,$y))->cmp); $showPartialCorrectAnswers = 1; ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.