WeBWorK Problems

finding std_problem_grader source

finding std_problem_grader source

by Patti Lamm -
Number of replies: 3
I need to modify a custom grader in order to allow for a reduced scoring period, so would like to look at the source code for either std_problem_grader or avg_problem_grader to see what is needed. My sys admin was not able to find these routines doing a grep of the usual places on our webwork server. Can someone tell me where he can find the source for one of these? Thanks.
In reply to Patti Lamm

Re: finding std_problem_grader source

by Arnold Pizer -
Hi Patricia,

You can find these in /opt/webwork/pg/macros/PGanswermacros.pl

Are you thinking of modifying one of the graders in PGgraders.pl or one of your own? I ask because I am thinking of adding reduced scoring to at least one of the graders in PGgraders.pl that seems to be used somewhat.

Arnie
In reply to Arnold Pizer

Re: finding std_problem_grader source

by Patti Lamm -
Thank you, Arnie. I'm modifying one of my own (at least I don't think there's an analog in PGgraders.pl) -- I have 10 questions on a given problem and will give 80% credit if any 9 answers are correct, 50% credit if any 8 are correct, 0% for 7 or less.

We use the reduced scoring option a great deal at our institution, so the more it's adopted in webwork routines, the better.


In reply to Patti Lamm

Re: finding std_problem_grader source

by Arnold Pizer -
Hi Patricia,

There is a grader that does what you want and it works with reduced credit.

Look at custom_problem_grader_fluid in
/opt/webwork/pg/macros/PGgraders.pl

Here is an example of the code that goes in a .pg problem:

install_problem_grader(~~&custom_problem_grader_fluid);
$ENV{'grader_numright'} = [2,4];
$ENV{'grader_scores'} = [0.5,1];
$ENV{'grader_message'} = "You can earn " .
"50% partial credit for 2 - 3 correct answers.";

This example comes from The National Problem Library in directory FortLewis/Calc3/12-3-Contour-diagrams/HGM4-12-3-18a-Contour-diagrams/HGM4-12-3-18a-Contour-diagrams.pg. You should be able to find more examples there or search for "custom_problem_grader_fluid".

Arnie