Skip to content

Commit d959e82

Browse files
committed
Round initial point value to match step size in SingleProblemGrader.
1 parent c475103 commit d959e82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/HTML/SingleProblemGrader/grader.html.ep

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
% } else {
8181
% $stepSize = int(($grader->{problem_value} - 1) / 100) + 1;
8282
% }
83+
% # Round point score to the nearest $stepSize.
84+
% param(
85+
% 'grader-problem-points',
86+
% wwRound(2, wwRound(0, $grader->{recorded_score} * $grader->{problem_value} / $stepSize) * $stepSize)
87+
% );
8388
<div class="row align-items-center mb-2">
8489
<%= label_for "score_problem$grader->{problem_id}_points",
8590
class => 'col-fixed col-form-label',
@@ -112,7 +117,6 @@
112117
<% end =%>
113118
<% end =%>
114119
<div class="col-sm">
115-
% param('grader-problem-points', wwRound(1, $grader->{recorded_score} * $grader->{problem_value}));
116120
<%= number_field 'grader-problem-points' => '',
117121
min => 0,
118122
max => $grader->{problem_value},

0 commit comments

Comments
 (0)