########################################################## # # 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", "parserUtils.pl", ); TEXT(beginproblem()); ########################################################## # # The setup # Context("Interval"); $a = non_zero_random(-5,5,1); $f = Formula("(x^2+1)/(x-$a)")->reduce; $R = Union("(-inf,$a) U ($a,inf)"); ########################################################## # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose \(\displaystyle f(x) = $f\). $PAR Then \(f\) is defined on the region \{ans_rule(30)\}. $PAR ${BCENTER} ${BSMALL} Several intervals can be combined using the set union symbol, ${LQ}${BTT}U${ETT}${RQ}.$BR Use ${LQ}${BTT}infinity${ETT}${RQ} for ${LQ}\(\infty\)${RQ} and ${LQ}${BTT}-infinity${ETT}${RQ} for ${LQ}\(-\infty\)${RQ}. ${ESMALL} ${ECENTER} END_TEXT Context()->normalStrings; ########################################################### # # The answer # ANS($R->cmp); $showPartialCorrectAnswers=1; ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.