|
1 | | -% use WeBWorK::Utils qw(wwRound getAssetURL); |
| 1 | +% use WeBWorK::Utils qw(wwRound getAssetURL points_stepsize round_nearest_stepsize); |
2 | 2 | % require WeBWorK::PG; |
3 | 3 | % |
4 | 4 | % content_for js => begin |
|
122 | 122 | <%= check_box 'select-all' => 'on', id => 'select-all', class => 'select-all form-check-input', |
123 | 123 | data => { select_group => 'mark_correct' } =%> |
124 | 124 | </th> |
125 | | - <th id="score-header"><%= maketext('Score (%)') %></th> |
| 125 | + % unless ($ce->{problemGraderScore} eq 'Point') { |
| 126 | + <th id="score-header"><%= maketext('Score (%)') %></th> |
| 127 | + % } |
| 128 | + % unless ($ce->{problemGraderScore} eq 'Percent') { |
| 129 | + <th id="point-header"><%= maketext('Points (0 - [_1])', $problem_value) %></th> |
| 130 | + % } |
126 | 131 | <th id="comment-header"><%= maketext('Comment') %></th> |
127 | 132 | </tr> |
128 | 133 | </thead> |
129 | 134 | <tbody> |
| 135 | + % my $stepSize = points_stepsize($problem_value); |
130 | 136 | % for my $user (@$users) { |
131 | 137 | % my $userID = $user->user_id; |
132 | 138 | % |
|
206 | 212 | class => 'mark_correct form-check-input', |
207 | 213 | 'aria-labelledby' => 'mark-all-correct-header' =%> |
208 | 214 | </td> |
209 | | - <td class="restricted-width-col"> |
210 | | - % param("$userID.$versionID.score", undef); |
211 | | - <%= number_field "$userID.$versionID.score" => |
212 | | - wwRound(0, $_->{problem}->status * 100), |
213 | | - class => 'score-selector form-control form-control-sm restricted-width-col', |
214 | | - style => 'width:6.5rem;', min => 0, max => 100, autocomplete => 'off', |
215 | | - 'aria-labelledby' => 'score-header' =%> |
216 | | - </td> |
| 215 | + % unless ($ce->{problemGraderScore} eq 'Point') { |
| 216 | + <td class="restricted-width-col"> |
| 217 | + % param("$userID.$versionID.score", undef); |
| 218 | + <%= number_field "$userID.$versionID.score" => wwRound(0, $_->{problem}->status * 100), |
| 219 | + id => "$userID.$versionID.score", |
| 220 | + class => 'problem-score form-control form-control-sm restricted-width-col', |
| 221 | + style => 'width:6.5rem;', min => 0, max => 100, step => 1, |
| 222 | + autocomplete => 'off', 'aria-labelledby' => 'score-header' =%> |
| 223 | + </td> |
| 224 | + % } |
| 225 | + % unless ($ce->{problemGraderScore} eq 'Percent') { |
| 226 | + <td class="restricted-width-col"> |
| 227 | + % if ($ce->{problemGraderScore} eq 'Point') { |
| 228 | + % param("$userID.$versionID.score", undef); |
| 229 | + <%= hidden_field "$userID.$versionID.score" => wwRound(0, $_->{problem}->status * 100), |
| 230 | + id => "$userID.$versionID.score" %> |
| 231 | + % } |
| 232 | + % param("$userID.$versionID.points", undef); |
| 233 | + <%= number_field "$userID.$versionID.points" => |
| 234 | + round_nearest_stepsize($_->{problem}->status * $problem_value, $stepSize), |
| 235 | + id => "$userID.$versionID.points", |
| 236 | + class => 'problem-points form-control form-control-sm restricted-width-col', |
| 237 | + style => 'width:6.5rem;', min => 0, max => $problem_value, step => $stepSize, |
| 238 | + autocomplete => 'off', 'aria-labelledby' => 'point-header' =%> |
| 239 | + </td> |
| 240 | + % } |
217 | 241 | <td class="grader-comment-column"> |
218 | 242 | % if (defined $_->{past_answer}) { |
219 | 243 | <%= text_area "$userID.$versionID.comment" => $_->{past_answer}->comment_string, |
|
0 commit comments