## DESCRIPTION ## Rotation ## ENDDESCRIPTION ## KEYWORDS('Rotation') ## Tagged by nhamblet ## DBsubject('WeBWorK') ## DBchapter('WeBWorK Tutorial') ## DBsection('WeBWorK Tutorial') ## Date('5/30/2000') ## Author('Joseph Neisendorfer') ## Institution('Rochester') ## TitleText1('') ## EditionText1('') ## AuthorText1('') ## Section1('') ## Problem1('') DOCUMENT(); # This should be the first executable line in the problem. loadMacros("PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl"); TEXT( beginproblem() ); \$showPartialCorrectAnswers = 1; #Array of choices @choices = ( "Wiggle His Nose", "Hug Himself", "Spread his arms wide", "Think of Galadriel", "Think of Sauron" ); #Array of 0, 1, .. ,4 in random order @permutation = NchooseK(5,5); #Permute the choices @randomChoices = @choices[@permutation]; #The following few lines ensure that the letter representing #the correct answer is also properly randomized @randomAnswers = @ALPHABET[&invert(@permutation)]; \$ans = \$randomAnswers[2]; BEGIN_TEXT As Gandalf falls into the depths of Moria, he begins to spin. If he wishes to slow his rate of spinning, he should do which of the following (type the appropriate letter)? \$PAR \{ans_rule(10)\} END_TEXT TEXT(&OL(@randomChoices)); ANS(str_cmp(\$ans)); ENDDOCUMENT(); # This should be the last executable line in the problem.