fix(exams): provide bonus information in return of examBonusGrade

This commit is contained in:
Gregor Kleen 2020-03-16 10:33:54 +01:00
parent ec6a8ae463
commit 731231d5ea

View File

@ -224,8 +224,8 @@ examBonusGrade :: ( MonoFoldable sheets
=> Exam => Exam
-> Either Points sheets -- ^ `Points` retrieved from relevant `ExamBonus`, iff it exists -> Either Points sheets -- ^ `Points` retrieved from relevant `ExamBonus`, iff it exists
-> results -> results
-> Maybe ExamResultGrade -> (Maybe Points, Maybe ExamResultGrade)
examBonusGrade exam@Exam{..} bonusInp = examGrade exam mBonus examBonusGrade exam@Exam{..} bonusInp = (mBonus, ) . examGrade exam mBonus
where mBonus = asum where mBonus = asum
[ bonusInp ^? _Left [ bonusInp ^? _Left
, examResultBonus <$> examBonusRule <*> bonusPossible <*> bonusAchieved , examResultBonus <$> examBonusRule <*> bonusPossible <*> bonusAchieved