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…')
 
(Add link to PGML version in OPL)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<h2>A List of Many Multiple Choice Questions with Common Answers</h2>
 
<h2>A List of Many Multiple Choice Questions with Common Answers</h2>
   
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;">
 
  +
[[File:ManyMultipleChoice1.png|300px|thumb|right|Click to enlarge]]
  +
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
 
This PG code shows how to construct a list of many multiple choice questions that share common answers.
 
This PG code shows how to construct a list of many multiple choice questions that share common answers.
<ul>
 
<li>Download file: [[File:ManyMultipleChoice1.txt]] (change the file extension from txt to pg when you save it)</li>
 
<li>File location in NPL: <code>NationalProblemLibrary/FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1.pg</code></li>
 
</ul>
 
 
</p>
 
</p>
  +
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1.pg FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1.pg]
  +
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1_PGML.pg FortLewis/Authoring/Templates/Misc/ManyMultipleChoice1_PGML.pg]
   
  +
  +
<br clear="all" />
 
<p style="text-align:center;">
 
<p style="text-align:center;">
 
[[SubjectAreaTemplates|Templates by Subject Area]]
 
[[SubjectAreaTemplates|Templates by Subject Area]]
Line 44: Line 45:
 
loadMacros(
 
loadMacros(
 
"PGstandard.pl",
 
"PGstandard.pl",
  +
"MathObjects.pl",
 
"PGchoicemacros.pl",
 
"PGchoicemacros.pl",
 
"PGgraders.pl",
 
"PGgraders.pl",
Line 54: Line 56:
 
<p>
 
<p>
 
<b>Initialization:</b>
 
<b>Initialization:</b>
  +
We use <code>PGchoicemacros.pl</code> to construct the list of multiple choice items, and the custom problem grader fluid from <code>PGgraders.pl</code> for incremental grading.
 
</p>
 
</p>
 
</td>
 
</td>
Line 64: Line 67:
 
<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 72: Line 77:
 
"No answer" => "?",
 
"No answer" => "?",
 
"True" => "True",
 
"True" => "True",
"False" => "False"
+
"False" => "False",
 
]);
 
]);
   
Line 100: Line 105:
 
<p>
 
<p>
 
<b>Setup:</b>
 
<b>Setup:</b>
  +
We can choose how many of the questions will be presented to students.
 
</p>
 
</p>
 
</td>
 
</td>
Line 151: Line 157:
 
<p>
 
<p>
 
<b>Answer Evaluation:</b>
 
<b>Answer Evaluation:</b>
  +
We must withhold feedback from students by setting <code>$showPartialCorrectAnswers = 0;</code>
  +
We use an incremental grader called <code>custom_problem_grader_fluid</code>. With this problem grader, you must specify the number of correct answers <code>[2,4,6]</code> and their corresponding scores <code>[0.3,0.6,1]</code> and update the grader message accordingly. The last entry in the array for <code>grader_numright</code> must be the total number of questions asked, and the last entry in the array for <code>grader_scores</code> must be 1 (otherwise nobody can earn full credit!).
  +
</p>
  +
<p>
  +
If you want a grader that awards full credit when all questions are correct and no credit otherwise, uncomment the standard problem grader.
 
</p>
 
</p>
 
</td>
 
</td>
Line 163: Line 174:
 
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("MathObject version.");
   
 
ENDDOCUMENT();
 
ENDDOCUMENT();
Line 173: Line 185:
 
<p>
 
<p>
 
<b>Solution:</b>
 
<b>Solution:</b>
  +
<br/>A method to match explanations with a shuffled list of matching problems is presented in
  +
[[MatchingProblems|Matching Problems]]
 
</p>
 
</p>
 
</td>
 
</td>
Line 184: Line 198:
   
 
[[Category:Top]]
 
[[Category:Top]]
[[Category:Authors]]
+
[[Category:Sample Problems]]
  +
[[Category:Subject Area Templates]]

Latest revision as of 22:02, 7 June 2015

A List of Many Multiple Choice Questions with Common Answers

Click to enlarge

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



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: We use PGchoicemacros.pl to construct the list of multiple choice items, and the custom problem grader fluid from PGgraders.pl for incremental grading.

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: We can choose how many of the questions will be presented to students.

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: We must withhold feedback from students by setting $showPartialCorrectAnswers = 0; We use an incremental grader called custom_problem_grader_fluid. With this problem grader, you must specify the number of correct answers [2,4,6] and their corresponding scores [0.3,0.6,1] and update the grader message accordingly. The last entry in the array for grader_numright must be the total number of questions asked, and the last entry in the array for grader_scores must be 1 (otherwise nobody can earn full credit!).

If you want a grader that awards full credit when all questions are correct and no credit otherwise, uncomment the standard problem grader.

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

COMMENT("MathObject version.");

ENDDOCUMENT();

Solution:
A method to match explanations with a shuffled list of matching problems is presented in Matching Problems

Templates by Subject Area