Difference between revisions of "ManyMultipleChoice1"

From WeBWorK_wiki
Jump to navigation Jump to search
(Created page with '<h2>A List of Many Multiple Choice Questions with Common Answers</h2> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> This PG code shows how to construc…')
 
Line 44: Line 44:
 
loadMacros(
 
loadMacros(
 
"PGstandard.pl",
 
"PGstandard.pl",
  +
"MathObjects.pl",
 
"PGchoicemacros.pl",
 
"PGchoicemacros.pl",
 
"PGgraders.pl",
 
"PGgraders.pl",
Line 64: Line 65:
 
<td style="background-color:#ffffdd;border:black 1px dashed;">
 
<td style="background-color:#ffffdd;border:black 1px dashed;">
 
<pre>
 
<pre>
  +
Context("Numeric");
  +
 
# Create and use pop up lists
 
# Create and use pop up lists
 
$tf = new_select_list();
 
$tf = new_select_list();
Line 163: Line 166:
 
BEGIN_SOLUTION
 
BEGIN_SOLUTION
 
${PAR}SOLUTION:${PAR}
 
${PAR}SOLUTION:${PAR}
The correct answers are
 
  +
You could put an explanation here.
\{ $tf -> ra_correct_ans() \}
 
 
END_SOLUTION
 
END_SOLUTION
 
Context()->normalStrings;
 
Context()->normalStrings;
  +
  +
COMMENT("MathObjects version.);
   
 
ENDDOCUMENT();
 
ENDDOCUMENT();

Revision as of 02:00, 2 December 2010

A List of Many Multiple Choice Questions with Common Answers

This PG code shows how to construct a list of many multiple choice questions that share common answers.

  • Download file: File:ManyMultipleChoice1.txt (change the file extension from txt to pg when you save it)
  • File location in NPL: NationalProblemLibrary/FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1.pg

Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"PGchoicemacros.pl",
"PGgraders.pl",
);

TEXT(beginproblem());

Initialization:

Context("Numeric");

# Create and use pop up lists 
$tf = new_select_list();
$tf->rf_print_q(~~&pop_up_list_print_q);

# Choices presented to students
$tf->ra_pop_up_list( [ 
"No answer" => "?", 
"True"  => "True", 
"False" => "False"
]);

# Questions and answers
$tf -> qa ( 
"All continuous functions are differentiable.",
"False",
"All differentiable functions are continuous.",
"True",
"All polynomials are differentiable.",
"True",
"All functions with positive derivatives are increasing.",
"True",
"All rational functions are continuous.",
"False",
"All exponential functions are differentiable.",
"True",
"All exponential functions are rational functions.",
"False",
);

# How many questions to use
$tf->choose(6);

Setup:

Context()->texStrings;
BEGIN_TEXT
Are the following statements true or false? 
$BR
\{ $tf -> print_q() \}
END_TEXT
Context()->normalStrings;

Main Text:

$showPartialCorrectAnswers = 0;

#
#  Incremental grader
#
install_problem_grader(~~&custom_problem_grader_fluid);
$ENV{'grader_numright'} = [2,4,6];
$ENV{'grader_scores'} = [0.3,0.6,1];
$ENV{'grader_message'} = "You can earn " .
"30% partial credit for 2 - 3 correct answers, and " .
"60% partial credit for 4 - 5 correct answers.";

#
#  All or nothing grader
#  
# install_problem_grader(~~&std_problem_grader);

ANS( str_cmp( $tf->ra_correct_ans() ) );

Answer Evaluation:

Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
You could put an explanation here.
END_SOLUTION
Context()->normalStrings;

COMMENT("MathObjects version.);

ENDDOCUMENT();

Solution:

Templates by Subject Area