########################################################### # # 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", "Differentiation.pl", ); TEXT(beginproblem()); ########################################################### # # The setup # Context('Vector')->variables->are(t=>'Real'); # # Define a function and its derivative and make them pretty # $a = random(1,8,1); $b = random(-8,8,1); $c = random(-8,8,1); $f = Formula("") -> reduce; $df = $f->D('t'); $t = random(-5,5,1); ########################################################### # # The problem text # Context()->texStrings; BEGIN_TEXT Suppose \(f(t) = $f\). $PAR Then \(f'(t) =\) \{ans_rule(20)\},$BR and \(f'($t) =\) \{ans_rule(20)\}. END_TEXT Context()->normalStrings; ########################################################### # # The answers # ANS($df->cmp); ANS($df->eval(t=>$t)->cmp); $showPartialCorrectAnswers = 1; ########################################################### ENDDOCUMENT(); # This should be the last executable line in the problem.