Parent Directory
|
Revision Log
New problems for the library.
1 DOCUMENT(); 2 loadMacros("PGbasicmacros.pl", 3 "PGchoicemacros.pl", 4 "PGanswermacros.pl", 5 6 ); 7 TEXT(beginproblem(), $BR,$BBOLD, "True False Problem", $EBOLD, $BR,$BR); 8 # Since this is a true questions, we do not usually wish to tell students which 9 # parts of the matching question have been answered correctly and which are 10 # incorrect. That is too easy. To accomplish this we set the following flag to 11 # zero. 12 $showPartialCorrectAnswers = 0; 13 14 # True false questions are a special case of a "select list" 15 # Make a new select list 16 $tf = new_select_list(); 17 # $tf now "contains" the select list object. 18 # Insert some questions and whether or not they are true. 19 20 $tf -> qa ( # each entry has to end with a comma 21 "If A and B are both square matrices such that AB equals BA equals the identity matrix, then B is the inverse matrix of A.", 22 "T", 23 "If A is a square matrix, then there exists a matrix B such that AB equals the identity matrix.", 24 "F", 25 "If \( AX = B \) represents a system of linear equations and \( A^{-1} \) exists, then the product \( A^{-1}B \) gives the solution to the system.", 26 "T", 27 ); # every statement has to end with a semi-colon. 28 29 # Choose two of the question and answer pairs at random. 30 $tf ->choose(2); 31 32 # Now print the text using $ml->print_q for the questions 33 # and $ml->print_a to print the answers. 34 35 BEGIN_TEXT 36 $PAR 37 38 Enter T or F depending on whether the statement is true or false. 39 (You must enter T or F -- True and False will not work.)$BR 40 41 \{ $tf-> print_q \} 42 43 $PAR 44 45 END_TEXT 46 47 # Enter the correct answers to be checked against the answers to the students. 48 49 ANS( str_cmp( $tf->ra_correct_ans ) ) ; 50 51 ENDDOCUMENT(); # This should be the last executable
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |