| 1 | |
1 | |
|
|
2 | =head1 PGgraders.pl DESCRIPTION |
|
|
3 | |
|
|
4 | Grader Plug-ins |
|
|
5 | |
|
|
6 | =cut |
|
|
7 | |
|
|
8 | =head3 full_partial_grader |
|
|
9 | |
|
|
10 | ########################################################### |
|
|
11 | # If the final answer is correct, then the problem is given full credit |
|
|
12 | # and a message is generated to that effect. Otherwise, partial credit |
|
|
13 | # is given for previous parts. |
|
|
14 | |
|
|
15 | =cut |
| 2 | |
16 | |
| 3 | sub full_partial_grader { |
17 | sub full_partial_grader { |
| 4 | # Get the standard inputs to a grader: |
18 | # Get the standard inputs to a grader: |
| 5 | my $rh_evaluated_answers = shift; |
19 | my $rh_evaluated_answers = shift; |
| 6 | my $rh_orig_problem_state = shift; |
20 | my $rh_orig_problem_state = shift; |
| … | |
… | |
| 11 | |
25 | |
| 12 | |
26 | |
| 13 | # Evaluate these inputs using the "average problem grader" |
27 | # Evaluate these inputs using the "average problem grader" |
| 14 | my ($rh_problem_result, $rh_problem_state) = |
28 | my ($rh_problem_result, $rh_problem_state) = |
| 15 | &avg_problem_grader($rh_evaluated_answers,$rh_orig_problem_state,%form_options); |
29 | &avg_problem_grader($rh_evaluated_answers,$rh_orig_problem_state,%form_options); |
| 16 | |
|
|
| 17 | |
|
|
| 18 | |
|
|
| 19 | |
|
|
| 20 | # #If the final answer is correct, then the problem is given full credit |
|
|
| 21 | # # and a message is generated to that effect. |
|
|
| 22 | |
|
|
| 23 | |
30 | |
| 24 | my $count = keys %{$rh_evaluated_answers}; |
31 | my $count = keys %{$rh_evaluated_answers}; |
| 25 | my $last_label = 'AnSwEr'.$count; |
32 | my $last_label = 'AnSwEr'.$count; |
| 26 | |
33 | |
| 27 | |
34 | |
| … | |
… | |
| 55 | |
62 | |
| 56 | # Return the results of grading the problem. |
63 | # Return the results of grading the problem. |
| 57 | ($rh_problem_result, $rh_problem_state); |
64 | ($rh_problem_result, $rh_problem_state); |
| 58 | } |
65 | } |
| 59 | |
66 | |
|
|
67 | =head3 custom_problem_grader_0_60_100(@rh_evaluated_answers,$rh_problem_state,%form_options) |
| 60 | |
68 | |
| 61 | ################################################################ |
69 | ################################################################ |
| 62 | # We need a special problem grader on this problem, since we |
70 | # We need a special problem grader on this problem, since we |
| 63 | # want the student to get full credit for all five answers correct, |
71 | # want the student to get full credit for all five answers correct, |
| 64 | # 60% credit for four correct, and 0% for three or fewer correct. |
72 | # 60% credit for four correct, and 0% for three or fewer correct. |
| … | |
… | |
| 70 | # |
78 | # |
| 71 | # To look at the problem itself, look for the boxed comment below |
79 | # To look at the problem itself, look for the boxed comment below |
| 72 | # announcing the problem itself. |
80 | # announcing the problem itself. |
| 73 | ################################################################ |
81 | ################################################################ |
| 74 | |
82 | |
|
|
83 | =cut |
| 75 | |
84 | |
| 76 | sub custom_problem_grader_0_60_100 { |
85 | sub custom_problem_grader_0_60_100 { |
| 77 | my $rh_evaluated_answers = shift; |
86 | my $rh_evaluated_answers = shift; |
| 78 | my $rh_problem_state = shift; |
87 | my $rh_problem_state = shift; |
| 79 | my %form_options = @_; |
88 | my %form_options = @_; |
| … | |
… | |
| 151 | (\%problem_result, \%problem_state); |
160 | (\%problem_result, \%problem_state); |
| 152 | |
161 | |
| 153 | |
162 | |
| 154 | } |
163 | } |
| 155 | |
164 | |
|
|
165 | =head3 NOTE: |
|
|
166 | |
| 156 | ################################################################ |
167 | ################################################################ |
| 157 | # This problem grader was contributed by Prof. Zig Fiedorowicz, |
168 | # This problem grader was contributed by Prof. Zig Fiedorowicz, |
| 158 | # Dept. of Mathematics, Ohio State University on 8/25/01. |
169 | # Dept. of Mathematics, Ohio State University on 8/25/01. |
| 159 | # As written, the problem grader should be put in a separate macro file. |
170 | # As written, the problem grader should be put in a separate macro file. |
| 160 | # If actually inserted into a problem, you need to replace a couple |
171 | # If actually inserted into a problem, you need to replace a couple |
| 161 | # of backslashes by double tildes. |
172 | # of backslashes by double tildes. |
| 162 | |
173 | # |
| 163 | # This is a generalization of the previous custom grader. |
174 | # This is a generalization of the previous custom grader. |
| 164 | # This grader expects two array references to be passed to it, eg. |
175 | # This grader expects two array references to be passed to it, eg. |
| 165 | # $ENV['grader_numright'] = [2,5,7,10]; |
176 | # $ENV['grader_numright'] = [2,5,7,10]; |
| 166 | # $ENV['grader_scores'] = [0.1,0.4,0.6,1] |
177 | # $ENV['grader_scores'] = [0.1,0.4,0.6,1] |
| 167 | # Both arrays should be of the same length, and in strictly |
178 | # Both arrays should be of the same length, and in strictly |
| … | |
… | |
| 182 | # for the problems should be passed via |
193 | # for the problems should be passed via |
| 183 | # $ENV{'grader_message'} = "The grading policy for this problem is..."; |
194 | # $ENV{'grader_message'} = "The grading policy for this problem is..."; |
| 184 | # or something similar. |
195 | # or something similar. |
| 185 | ################################################################ |
196 | ################################################################ |
| 186 | |
197 | |
|
|
198 | =cut |
| 187 | |
199 | |
| 188 | sub custom_problem_grader_fluid { |
200 | sub custom_problem_grader_fluid { |
| 189 | my $rh_evaluated_answers = shift; |
201 | my $rh_evaluated_answers = shift; |
| 190 | my $rh_problem_state = shift; |
202 | my $rh_problem_state = shift; |
| 191 | my %form_options = @_; |
203 | my %form_options = @_; |