Difference between revisions of "WeightedGrader"
m |
m |
||
Line 13: | Line 13: | ||
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
− | <em>Standard Problem Grader: give full credit if all answers are correct and zero credit if some answers are incorrect. |
+ | <em><b>Standard Problem Grader:</b> give full credit if all answers are correct and zero credit if some answers are incorrect. |
</em> |
</em> |
||
</p> |
</p> |
||
Line 69: | Line 69: | ||
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
− | <em>Weighted Grader: assign different weights (percentages) to each answer in a problem. |
+ | <em><b>Weighted Grader:</b> assign different weights (percentages) to each answer in a problem. |
</em> |
</em> |
||
</p> |
</p> |
Revision as of 23:22, 12 November 2009
Weighted Graders
If a question has n answer blanks, the default weight to each answer 1/n. We describe several different ways to weight answers differently.
- The standard problem grader assigns full credit if all answers are correct, and zero credit of some answers are incorrect. This all-or-nothing grader should always be used for matching, multiple choice, and true / false questions, otherwise students will be able to deduce how many answers are correct by the partial credit reported by webwork.
- The weighted grader allows you to assign a weight to each answer blank in a problem.
- The weighted grader with the credit answer option allows you to specify one answer blank to be the final answer which, if answered correctly, will provide full credit for all other answer blanks in the problem. (This is not yet documented here.)
Standard Problem Grader: give full credit if all answers are correct and zero credit if some answers are incorrect.
PG problem file | Explanation |
---|---|
####################### # Initialization loadMacros("PGanswermacros.pl"); # Usual setup and main text go here ####################### # Answer evaluation install_problem_grader(~~&std_problem_grader); $showPartialCorrectAnswers = 0; ANS($a->cmp()); ANS($b->cmp()); ANS($c->cmp()); |
Initialization: Be sure to load
Answer Evaluation: We use
|
Weighted Grader: assign different weights (percentages) to each answer in a problem.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "PGcourse.pl", "MathObjects.pl", "weightedGrader.pl", ); install_weighted_grader(); TEXT(beginproblem); |
Initialization: We need to include the |
Context("Numeric"); Context()->variables->add(t=>"Real"); Context()->strings->add(A=>{},B=>{}); $r = random(2,4,1); $answer1 = Real("pi * $r**2"); $answer2 = Formula("($r - 1) * x**2 * t") -> reduce; $answer3 = String("A"); |
Set-up: To show how this works with MathObjects, we add some variables and strings to the context. |
Context()->texStrings; BEGIN_TEXT Enter \( \pi $r^2 \): \{ans_rule(10)\} Enter \( $answer2 \): \{ans_rule(10)\} Enter A: \{ans_rule(10)\} END_TEXT Context()->normalStrings; |
Main Text: Answer boxes are as usual. |
$showPartialCorrectAnswers = 0; WEIGHTED_ANS( ($answer1)->cmp(), 40 ); WEIGHTED_ANS( ($answer2)->cmp(), 40 ); WEIGHTED_ANS( ($answer3)->cmp(), 20 ); ENDDOCUMENT(); |
Answer Evaluation: Use |