Skip to content

Commit 542991d

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

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

templates/HTML/SingleProblemGrader/grader.html.ep

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@
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(
87+
% 2,
88+
% wwRound(0, $grader->{recorded_score} * $grader->{problem_value} / $stepSize) * $stepSize
89+
% )
90+
% );
8391
<div class="row align-items-center mb-2">
8492
<%= label_for "score_problem$grader->{problem_id}_points",
8593
class => 'col-fixed col-form-label',
@@ -112,7 +120,6 @@
112120
<% end =%>
113121
<% end =%>
114122
<div class="col-sm">
115-
% param('grader-problem-points', wwRound(1, $grader->{recorded_score} * $grader->{problem_value}));
116123
<%= number_field 'grader-problem-points' => '',
117124
min => 0,
118125
max => $grader->{problem_value},

0 commit comments

Comments
 (0)