## WeBWorK Main Forum

### How split credit between on-line, on-paper parts

by Murray Eisenberg -
Number of replies: 10
I have a question that is to count for 20 out of a total of 100 on a set consisting of 5 problems. But it has two parts: part (a) is on-line and is worth 12 of those 20 points; part (b) is going to be done on paper and handed in for the additional 8 points.

What weight do I assign to this question so that the total reported by Scoring tools includes those 12 points (together with the 4 * 20 = 80 points from the other questions) -- and so then I can just add the credit for the on-paper part to my records in a spreadsheet.

That is, does WebWorK really use what I enter as weights as weights and then scale everything in its reports in relation to a total of 100%. That's NOT what I want! I want the maximum total credit WeBWorK records for this set to be only 12 + 4*20 = 92.

### Re: How split credit between on-line, on-paper parts

by Jason Aubrey -
Hi Murray,

I'm not exactly sure what you want to do here, but I believe you can set an individual problem to record x% when the student answers everything correctly with something like this:

Suppose your problem has three answer blanks. Then pick weight1 + weigth2 + weight3 = x and do

### Re: How split credit between on-line, on-paper parts

by Michael Gage -
Hi Murray,

Weight is often used inconsistently. In the Homework editor weight means exactly points -- so if you set the weight to 100 the student will see:

(100 pts)

appearing near the top of their question.

$ENV{} is simply a hash variable that can be used to pass data back and forth within your problem. You define it in your problem and it is used in the grader. In the weighted_partial_grader, weight is used in the sense of weighted average if you have 4 questions and the weights 25, 25, 25, 25 each question will receive the same weight in calculating the final score. If you use .25, .25, .25, .25 you get exactly the same effect. Jason's clever suggestion is to add a "fake" weight so if you use 20, 20, 20, 20, 20 then each question will receive 1/5 weight including the last question, which doesn't appear on the screen but refers to your paper homework. The maximum a student can get in this case is 80%. The grader doesn't check that there is no corresponding question to the last weight in the WeBWorK homework. The student sees these messages at the bottom of their screen. Note: You get the rest of the credit from handing in the paper homework Your score was recorded. You have attempted this problem 6 times. You received a score of 80% for this attempt. Your overall recorded score is 100%. You have unlimited attempts remaining.  I used the code below which I placed shortly after the loadMacros(..."PGasu.pl"..); subroutine call. You need to include "PGasu.pl" in the loadMacros() file list since that is where the "weighted_partial_grader" subroutine is defined.  install_problem_grader(~~&weighted_partial_grader);$ENV{partial_weights} = [.5,.2,.1,.2];
$ENV{grader_message} = "You get the rest of the credit from handing in the paper homework"; You can ignore the "overall recorded score " message. That represents the highest score achieved by the student -- and while I was experimenting I got 100%. Notice how the grader_message is defined. The result from the grader is the "status" as defined in the Homework editor and it is multiplied times the "weight" to get the reported grade. So 80% for a 100 point weighted problem counts 80 points. Good luck. Hope this helps.  -- Mike  In reply to Jason Aubrey ### Re: How split credit between on-line, on-paper parts by Murray Eisenberg - When I add the$ENV{'partial_weights'} and install_problem_grader lines to the .pg file, I get error:
Undefined subroutine &main::weighted_partial_grader called at (eval 2141) line 1
and call stack:
# in WeBWorK::PG::Local::new called at line 52 of /opt/webwork/webwork2/lib/WeBWorK/PG.pm
# in WeBWorK::PG::new called at line 598 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm
# in WeBWorK::ContentGenerator::Problem::pre_header_initialize called at line 176 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
# in WeBWorK::ContentGenerator::go called at line 353 of /opt/webwork/webwork2/lib/WeBWorK.pm

The file includes, before that \$ENV line, the code:
loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGauxiliaryFunctions.pl",
"PGgraphmacros.pl",
"MathObjects.pl",
)


### Re: How split credit between on-line, on-paper parts

by Michael Gage -

"PGasu.pl",

to that list. That is the file that contains the


loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGauxiliaryFunctions.pl",
"PGgraphmacros.pl",
"PGasu.pl",
"MathObjects.pl",
)

### Re: How split credit between on-line, on-paper parts

by Davide Cervone -
An alternative might be to use an essay-style question within WeBWorK itself. (If you don't need much in the way of mathematical notation within the essay.) See

http://omega.math.union.edu/webwork2/UNION-examples/

for some essay question examples. Read the instructions in the grey areas at the right for details. If you log in as a professor, be sure to act as a student in order to see what the professor interface is like (the code tells if you are a professor by the fact that you are acting as someone else).

Use the "Show problem source" button to see the comments in the source file that tell you want the features of the problem are.

Use the "pretend the problem is past due" checkbox to enable the professor to grade the problem.

Anyway, these were some experiments on how to use WeBWorK for essay type problems. That might be useful to you.

Davide

### Re: How split credit between on-line, on-paper parts

by Murray Eisenberg -
Davide,

Very useful; thanks! Wish I had known about these a few weeks ago. Is "answerEssay.pl" already available in the standard distribution of WeBWorK?

I don't see a way to get the source for the "discussion" homework set. Is this strictly a local experiment right now, or are the requisite macros available in the standard distribution of WeBWorK?

### Re: How split credit between on-line, on-paper parts

by Davide Cervone -
The needed macro files can be obtained at

http://cvs.webwork.rochester.edu/viewcvs.cgi/union_problib/examples/?cvsroot=Union+College

Both the discussion and essay macros are experimental, and were written to test the limits of what could be done with WeBWorK. I do know that Raghu Gompa is using the discussion macros in his courses, but I don't know of anyone using the essay questions.

The discussion macros are interesting, but are probably not really up to the standards for classroom use (Raghu not withstanding). It implements only a flat discussion, not a threaded one, and really was just a test to see what was possible.

Both discussion and essay answers were supposed to allow students to enter mathematics using backticks and algebra-style notation, but that doesn't seem to be working right now. It may be because the EV3P macros that underly that have been folded into the main WeBWorK macros, and the defaults are different. Not sure, and I haven't looked into it. The code is several years old, now, but I'm sure it could be made to work again if you need that functionality.

You can give them a try and see what works for you. If you run into problems, let me know.

Davide

### Re: How split credit between on-line, on-paper parts

by Murray Eisenberg -
Can I just upload the .pl files to my course directory and expect them to be found when I include them in the loadMacros command in a .pf file?

Or, instead, must the sysadmin put them at a higher level? If so, what are the csv commands (or other method) to use?
You can put them in the course templates/macros directory and they will be found automatically when used by a .pg file.