fix: bound confirmed points and the attempt percentage
WR-05: Confirm clamps the grader's score to the question's current points, so lowering a question's points no longer lets a confirm store more than full marks, and Totals caps the percentage at 100 when a question's points were raised after the attempt was scored.
This commit is contained in:
@@ -84,6 +84,7 @@ func TestTotals(t *testing.T) {
|
||||
{[]float64{2, -0.5}, 4, 1.5, 37.5},
|
||||
{nil, 0, 0, 0},
|
||||
{[]float64{1}, 1, 1, 100},
|
||||
{[]float64{3}, 2, 3, 100},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
score, pct := classes.Totals(tc.points, tc.max)
|
||||
|
||||
Reference in New Issue
Block a user