µ¦å{h
HomeCurrent UR coursesVisitor pageIntro to WeBWorKWeBWorK 2 TwikiWW CommunityGrant Support & awardsDiscussion groupProblem libraryWrite/modify problemsCreate & manage courseTutorial on running a courseHowTosFAQWeBWorK2 FAQSoftware DownloadHow to Install WW serverFeedbackSite MapChange preferencesChange password
|
The true false basic example(for more advanced information on select lists, see Select.pm) To obtain this problem
WARNINGS µ¦å{h
##DESCRIPTION
##
##ENDDESCRIPTION
## Tagged by jjh2b
## DBsubject('WeBWorK')
## DBchapter('WeBWorK Tutorial')
## DBsection('MAA Tutorial')
## Date('8/30/07')
## Author('')
## Institution('')
## TitleText1('')
## EditionText1('')
## AuthorText1('')
## Section1('')
## Problem1('')
DOCUMENT();
loadMacros("PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
);
TEXT(beginproblem(), $BR,$BBOLD, "True False Example", $EBOLD, $BR,$BR);
# Since this is a true questions, we do not usually wish to tell students which
# parts of the matching question have been answered correctly and which are
# incorrect. That is too easy. To accomplish this we set the following flag to
# zero.
$showPartialCorrectAnswers = 0;
# True false questions are a special case of a "select list"
# Make a new select list
$tf = new_select_list();
# $tf now "contains" the select list object.
# Insert some questions and whether or not they are true.
$tf -> qa ( # each entry has to end with a comma
"All continuous functions are differentiable.",
"F",
"All differentiable functions are continuous.",
"T",
"All polynomials are differentiable.",
"T",
"All functions with positive derivatives are increasing.",
"T",
"All compact sets are closed",
"T",
"All closed sets are compact",
"F",
"All increasing functions have positive deriviatives",
"F",
"All differentiable strictly increasing functions have non-negative derivatives
at every point",
"T",
);
# Choose four of the question and answer pairs at random.
$tf ->choose(4);
# Now print the text using $ml->print_q for the questions
# and $ml->print_a to print the answers.
BEGIN_TEXT
$PAR
Enter T or F depending on whether the statement is true or false.
(You must enter T or F -- True and False will not work.)$BR
\{ $tf-> print_q \}
$PAR
END_TEXT
# Enter the correct answers to be checked against the answers to the students.
ANS(str_cmp( $tf->ra_correct_ans ) ) ;
ENDDOCUMENT(); # This should be the last executable line in the problem.
<!--
Enter this code
-->
Comments:
|
||
Last update: Monday, March 18, 2002 at 2:29:24 PM.
This site maintained using Manila and Frontier software. |
|||