## DESCRIPTION ## Multiple choice template ## ENDDESCRIPTION ## KEYWORDS('multiple choice', 'template') ## 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", "parserRadioButtons.pl", ); TEXT(beginproblem()); ########################### # Setup Context("Numeric"); $radio = RadioButtons( ["Red","Blue","Green","None of these"], "Blue", # correct answer last => ["None of these"], # can be a list ); ########################### # Main text Context()->texStrings; BEGIN_TEXT My favorite color is $BR $BR \{ $radio->buttons() \} END_TEXT Context()->normalStrings; ############################ # Answer evaluation install_problem_grader(~~&std_problem_grader); $showPartialCorrectAnswers = 0; ANS( $radio->cmp() ); ############################ # Solution Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:$PAR The correct answer is \{ $radio->correct_ans() \} END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT();