[npl] / trunk / NationalProblemLibrary / Rochester / setVectors0Introduction / ur_vc_0_6.pg Repository:
ViewVC logotype

Annotation of /trunk/NationalProblemLibrary/Rochester/setVectors0Introduction/ur_vc_0_6.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 238 - (view) (download)

1 : jjholt 205 ## DESCRIPTION
2 :     ## Rotation
3 :     ## ENDDESCRIPTION
4 : jj 140
5 : jjholt 205 ## KEYWORDS('Rotation')
6 :     ## Tagged by nhamblet
7 : jj 140
8 : jjholt 205 ## DBsubject('WeBWorK')
9 : jj 238 ## DBchapter('WeBWorK Tutorial')
10 :     ## DBsection('WeBWorK Tutorial')
11 : jjholt 205 ## Date('5/30/2000')
12 :     ## Author('Joseph Neisendorfer')
13 :     ## Institution('Rochester')
14 :     ## TitleText1('')
15 :     ## EditionText1('')
16 :     ## AuthorText1('')
17 :     ## Section1('')
18 :     ## Problem1('')
19 :    
20 : jj 140 DOCUMENT(); # This should be the first executable line in the problem.
21 :    
22 :     loadMacros("PG.pl",
23 :     "PGbasicmacros.pl",
24 :     "PGchoicemacros.pl",
25 :     "PGanswermacros.pl",
26 :     "PGauxiliaryFunctions.pl");
27 :    
28 :     TEXT( beginproblem() );
29 :     $showPartialCorrectAnswers = 1;
30 :    
31 :     #Array of choices
32 :     @choices = ( "Wiggle His Nose",
33 :     "Hug Himself",
34 :     "Spread his arms wide",
35 :     "Think of Galadriel",
36 :     "Think of Sauron"
37 :     );
38 :    
39 :     #Array of 0, 1, .. ,4 in random order
40 :     @permutation = NchooseK(5,5);
41 :    
42 :     #Permute the choices
43 :     @randomChoices = @choices[@permutation];
44 :    
45 :     #The following few lines ensure that the letter representing
46 :     #the correct answer is also properly randomized
47 :     @randomAnswers = @ALPHABET[&invert(@permutation)];
48 :     $ans = $randomAnswers[2];
49 :    
50 :     BEGIN_TEXT
51 :     As Gandalf falls into the depths of Moria, he begins to spin. If he wishes to slow his rate of spinning, he should
52 :     do which of the following (type the appropriate letter)?
53 :     $PAR
54 :     \{ans_rule(10)\}
55 :     END_TEXT
56 :    
57 :     TEXT(&OL(@randomChoices));
58 :    
59 :     ANS(str_cmp($ans));
60 :    
61 :     ENDDOCUMENT(); # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9