## Forum archive 2000-2006

### Arnold K. Pizer - Decreasing the score with number of attempts

by Arnold Pizer -
Number of replies: 0
 Decreasing the score with number of attempts topic started 5/30/2001; 3:42:37 PMlast post 6/4/2001; 10:47:36 AM
 Arnold K. Pizer - Decreasing the score with number of attempts  5/30/2001; 3:42:37 PM (reads: 1310, responses: 2) From: robbins@math.utah.edu Comments: ---- Hi WeBWorK help, In the set definition file it is possible to set the score for a problem and the maximum number of tries. Is it possible to have the score decrease with the number of attempts made by the student? Thank you, Tom <| Post or View Comments |>

 Arnold K. Pizer - Re: Decreasing the score with number of attempts  5/30/2001; 4:24:12 PM (reads: 1570, responses: 0) Yes this is possible, but we have not written a problem grader that does this since there are many ways of decreasing the score based on the number of attempts. You have to write a custom problem grader. See the examples in setSampleGraders for how to call these in a WeBWorK problem. I'll show you how to write one below. Lets call our new grader decreasing_avg_problem_grader since it will be a variant of avg_problem_grader. If you are going to use this for many problems, you could put your new grader in a file called PGgraders.pl and in that file put the sub decreasing_avg_problem_grader { ...} Put the file PGgraders.pl in the courseScripts directory and load it into your problem with loadMacros so your would have code looking like loadMacros("PG.pl","PGbasicmacros.pl","PGchoicemacros.pl","PGanswermacros.pl","PGauxiliaryFunctions.pl","PGgraders.pl");install_problem_grader(~~&decreasing_avg_problem_grader ); This is the method used by Prof. Zig Fiedorowicz of OSU for his custom graders.Now how do you write a decreasing grader? Look at the sub avg_problem_grader in .../system/courseScripts/PGanswermacros.pl . You can copy this sub, rename it decreasing_avg_problem_grader and then modify it as follows. Near the end of the subroutine you will find $problem_state{recorded_score} =$problem_result{score}if $problem_result{score} >$problem_state{recorded_score};$problem_state{num_of_correct_ans}++ if$total == $count;$problem_state{num_of_incorrect_ans}++ if $total <$count ; Note: the $problem_result{score} is a number in the range [0,1] that gets multiplied by the value of the problem (usually 1,2, ... or 10 points) to get the actual student sccore on the problem. This code replaces the recorded score by the current score if the current score is higher. You also see that you have available the recorded number of correct and incorrect attempts. Just before this code you can modify$problem_result{score}, decreasing it based on the number of attempts or the number of incorrect attempts. E.g. $problem_result{score} = .5*$problem_result{score} if $problem_state{num_of_incorrect_ans} > 3; only allows 50% of the possible score after 3 incorrect attempts. You also have to decide if you want to replace a higher score with a lower one. We do not do this since it discourages students from attempting to get the correct answer. Finally, you should replace the line $problem_result{msg} = 'You can earn partial credit on this problem.' if \$count > 1; by a message explaining to the student how the problem will be graded. I would be cautious using decreasing scoring methods. In our experience, we have found that allowing students unlimited attempts without penalty encourges them to work on problems until they get them correct. <| Post or View Comments |>

 Gavin LaRose - Re: Decreasing the score with number of attempts  6/4/2001; 10:47:36 AM (reads: 1667, responses: 0) I wrote a problem grader that may do something similar to what you asked about; it doesn't allow partial credit, but does assign a decreasing amount of credit with subsequent attempts. In particular, it allows the specification of the number of attempts to allow while giving full credit, and then a reduction of credit for subsequent attempts. We used it last year with four or five attempts at full credit, and then 70%, 50%, 30% and 10% credit for attempts five through eight or six through nine; all attempts after the eighth or ninth earned no credit. If you're interested, let me know and I can forward the code for this to you. I found that the difficulty with this particular grader is that I couldn't also allow students to get partial credit on a multi-part question, because I didn't have data on which parts of the problem they had gotten right (this was in version 1.5; I don't know if this could be changed for 1.6). In part because of this, we are now changing to a policy where students have a fixed number of attempts to get full credit (probably six) and can get full credit on any of those attempts. (Students also like the idea of getting credit for those parts of the problem they got right, so it's partly a political change as well.) In either case, the objective is to encourage students to stop and work out the problem before going and submitting it. After next term I should have some data about whether there's any obvious difference in the effectiveness of the two incentive methods. Gavin <| Post or View Comments |>