From 854fa6b968ed01d60dea0d9ba6fc93d37e5ec361 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 15 Feb 2021 12:55:12 +0100 Subject: [PATCH] fix(exam-bonus): fix rounding Fixes #672 --- src/Handler/Utils/Exam.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index c3197f1b5..67d0b310e 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -178,7 +178,7 @@ examResultBonus bonusRule bonusPossible bonusAchieved = case bonusRule of passesPossible = getSum $ numSheetsPasses bonusPossible pointsPossible = getSum $ sumSheetsPoints bonusPossible - sumSheetsPassPoints bonusPossible - roundToPoints' mult = (* mult) . roundToPoints . (/ toRational mult) + roundToPoints' mult = (* mult) . (realToFrac :: Uni -> Points) . roundToPoints . (/ toRational mult) examGrade :: ( MonoFoldable mono , Element mono ~ ExamResultPoints