## DESCRIPTION ## Algebra: fraction answer ## ENDDESCRIPTION ## KEYWORDS('algebra', 'fraction 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", "contextFraction.pl", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); ########################### # Setup Context("Fraction-NoDecimals"); $answer = Compute("3/2"); ########################### # Main text Context()->texStrings; BEGIN_TEXT Simplify $$\displaystyle \frac{6}{4}$$.$BR $BR Answer = \{ ans_rule(20) \} \{ AnswerFormatHelp("fractions") \} END_TEXT Context()->normalStrings; ############################ # Answer evaluation$showPartialCorrectAnswers = 1; ANS( $answer->cmp( studentsMustReduceFractions=>1, reduceFractions=>1, allowMixedNumbers=>0, ) ); ############################ # Solution Context()->texStrings; BEGIN_SOLUTION${PAR}SOLUTION:\${PAR} Factor and cancel to obtain $$\displaystyle answer$$ END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();