[rochester] / trunk / rochester_problib / set0 / prob2.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/rochester_problib/set0/prob2.pg

Mon Jun 25 19:20:51 2001 UTC (11 years, 11 months ago) by sam
File size: 2015 byte(s)
added problem library as webwork/ww_prob_lib with revision tag prob-lib-2


    1 ##DESCRIPTION
2 ##  sample true-false question
3 ##ENDDESCRIPTION
4
5 ##KEYWORDS('true-false')
6
7 DOCUMENT();        # This should be the first executable line in the problem.
8
10 "PG.pl",
11 "PGbasicmacros.pl",
12 "PGchoicemacros.pl",
14 "PGauxiliaryFunctions.pl"
15 );
16
17 TEXT(&beginproblem);
18 $showPartialCorrectAnswers = 1; 19 20 TEXT(EV2(<<EOT)); 21 This problem demonstrates a WeBWorK True/False question.$PAR
22 Enter a T or an F in each answer space below
23 to indicate whether the corresponding statement is true or
24 false.$BR 25 You must get all of the answers correct to receive credit. 26$BR
27 EOT
28
29 ## First we set up our variables.
30 $a = random(1,5,1); 31$b = random(6,10,1);
32 $c = random(-10,-1,1); 33$d = random(-10,-1,1);
34 $e = random(1,10,1); 35 36$questStr1 = EV2(" $$-a \lt -b$$");
37 $ansStr1 = "F"; 38$questStr2 = EV2(" $$c \leq c$$");
39 $ansStr2 = "T"; 40$questStr3 = EV2(" $$d \lt d$$");
41 $ansStr3 = "F"; 42$questStr4 = EV2(" $$\pi \geq 3.1416$$");
43 $ansStr4 = "F"; 44$questStr5 = EV2(" $$e-1 \leq e$$");
45 $ansStr5 = "T"; 46 47 @questions =($questStr1,$questStr2,$questStr3,$questStr4,$questStr5);
48 @answers =( $ansStr1,$ansStr2,$ansStr3,$ansStr4,$ansStr5); 49 50 ## Now choose randomly 4 questions out of the 5 question strings above. 51 52 @slice = NchooseK(scalar(@questions),4); 53 54 ## Next we output the 4 chosen questions. #match_ 55 TEXT( 56 &match_questions_list(@questions[@slice]) 57 ); 58 59 &ANS(str_cmp([ @answers[@slice] ] )); 60 TEXT(<<EOT); 61$PAR Notice that if one of your answers is wrong then, in this problem, WeBWorK will tell you which
62 parts are wrong and which parts are right.  This is the behavior for most problems, but for true/false
63 or multiple choice questions
64 WeBWorK will usually only tell you whether or not all the answers are correct.
65 It won't tell you which ones are wrong.  The idea is to encourage you think rather than to just try guessing.
66 \$PAR
67 In every case all of the
68 answers must be correct before you get credit for the problem.
69
70
71 EOT
72 ENDDOCUMENT();        # This should be the last executable line in the problem.