From: Matt L. v. a. <we...@ma...> - 2007-09-11 20:17:57
|
Log Message: ----------- New Unit Testing, ensures proper setup. Added Files: ----------- wwmoodle/wwquestion/simpletest: sampleProblem.pg testquestiontype.php Revision Data ------------- --- /dev/null +++ wwquestion/simpletest/sampleProblem.pg @@ -0,0 +1,30 @@ +# marks_first_test.pg #Standard Probability Problem #Drawing colored marbles from a bag + +DOCUMENT(); + +loadMacros("PG.pl", + "PGbasicmacros.pl", + "PGchoicemacros.pl", + "PGanswermacros.pl", + "PGauxiliaryFunctions.pl"); + +TEXT(beginproblem()); +$showPartialCorrectAnswers = 0; + +$total = random(15,25,1); +$some = random(5,10,1); + +BEGIN_TEXT; +You own $total CDs. You want to randomly arrange $some of them in a CD rack. +What is the probability that the rack ends up in alphabetical order? +$BR +$BR +The probability that the CDs are in alphabetical order is \{ans_rule(15)\}. +END_TEXT + +$ans = 1/fact($some); + +ANS(num_cmp($ans, mode => 'std')); + +ENDDOCUMENT(); + |