|
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 | + <th> |
| 126 | + % unless ($ce->{problemGraderScore} eq 'Point') { |
| 127 | + <div id="score-header"><%= maketext('Score (%)') %></div> |
| 128 | + % } |
| 129 | + % unless ($ce->{problemGraderScore} eq 'Percent') { |
| 130 | + <div id="point-header"><%= maketext('Points (0 - [_1])', $problem_value) %></div> |
| 131 | + % } |
| 132 | + </th> |
126 | 133 | <th id="comment-header"><%= maketext('Comment') %></th> |
127 | 134 | </tr> |
128 | 135 | </thead> |
|
207 | 214 | 'aria-labelledby' => 'mark-all-correct-header' =%> |
208 | 215 | </td> |
209 | 216 | <td class="restricted-width-col"> |
| 217 | + % my $mb = $ce->{problemGraderScore} eq 'Percent' ? '' : ' mb-1'; |
| 218 | + % my $score = wwRound(0, $_->{problem}->status * 100); |
210 | 219 | % 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' =%> |
| 220 | + % if ($ce->{problemGraderScore} eq 'Point') { |
| 221 | + <%= hidden_field "$userID.$versionID.score" => $score, |
| 222 | + id => "$userID.$versionID.score" %> |
| 223 | + % } else { |
| 224 | + <%= number_field "$userID.$versionID.score" => $score, |
| 225 | + id => "$userID.$versionID.score", |
| 226 | + class => 'problem-score score-selector form-control form-control-sm ' |
| 227 | + . "restricted-width-col$mb", |
| 228 | + style => 'width:6.5rem;', min => 0, max => 100, step => 1, |
| 229 | + autocomplete => 'off', 'aria-labelledby' => 'score-header' =%> |
| 230 | + % } |
| 231 | + % unless ($ce->{problemGraderScore} eq 'Percent') { |
| 232 | + % param("$userID.$versionID.points", undef); |
| 233 | + % my $stepSize = points_stepsize($problem_value); |
| 234 | + <%= number_field "$userID.$versionID.points" => |
| 235 | + round_nearest_stepsize($_->{problem}->status * $problem_value, $stepSize), |
| 236 | + id => "$userID.$versionID.points", |
| 237 | + class => 'problem-points score-selector form-control form-control-sm ' |
| 238 | + . 'restricted-width-col', |
| 239 | + style => 'width:6.5rem;', min => 0, max => $problem_value, step => $stepSize, |
| 240 | + autocomplete => 'off', 'aria-labelledby' => 'point-header' =%> |
| 241 | + % } |
216 | 242 | </td> |
217 | 243 | <td class="grader-comment-column"> |
218 | 244 | % if (defined $_->{past_answer}) { |
|
0 commit comments