## DESCRIPTION ## Trigonometry: disable functions and require exact fractions as answers. ## ENDDESCRIPTION ## KEYWORDS('trigonometry', 'exact answer') ## DBsubject('WeBWorK') ## DBchapter('WeBWorK Tutorial') ## DBsection('Fort Lewis Tutorial 2011') ## Date('01/30/2011') ## Author('Paul Pearson') ## Institution('Fort Lewis College') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') ########################### # Initialization DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "contextFraction.pl", ); TEXT(beginproblem()); ########################### # Setup Context("Fraction-NoDecimals"); $f1 = Formula("cos(pi)"); $f2 = Formula("sin(pi/3)"); Context()->functions->disable("All"); Context()->functions->enable("sqrt"); $answer1 = Compute("-1"); $answer2 = Compute("sqrt(3)/2"); ########################### # Main text Context()->texStrings; BEGIN_TEXT Enter your answers as simplified fractions. $BR $BR \( $f1 = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("fractions") \} $BR $BR \( $f2 = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("fractions") \} END_TEXT Context()->normalStrings; ########################### # Answer evaluation $showPartialCorrectAnswers = 1; ANS( $answer1->cmp() ); ANS( $answer2->cmp() ); ########################### # Solution Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} The cosine of an angle is zero when the angle is an integer multiple of \( \pi \). END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();