From c443ee4e0d88394978d83091b9f62ea27613f7bd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 20 Oct 2019 12:04:46 +0200 Subject: [PATCH] style(corrections-overview): better present tutorial assignments --- src/Model/Types/Sheet.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Model/Types/Sheet.hs b/src/Model/Types/Sheet.hs index c1e9ab72e..d545c5bbb 100644 --- a/src/Model/Types/Sheet.hs +++ b/src/Model/Types/Sheet.hs @@ -316,11 +316,12 @@ derivePersistField "CorrectorState" showCompactCorrectorLoad :: Load -> CorrectorState -> Text showCompactCorrectorLoad load CorrectorMissing = "[" <> showCompactCorrectorLoad load CorrectorNormal <> "]" showCompactCorrectorLoad load CorrectorExcused = "{" <> showCompactCorrectorLoad load CorrectorNormal <> "}" -showCompactCorrectorLoad Load{..} CorrectorNormal = proportionText <> tutorialText +showCompactCorrectorLoad Load{..} CorrectorNormal | byProportion == 0 = tutorialText + | otherwise = proportionText <> " + " <> tutorialText where proportionText = let propDbl :: Double propDbl = fromRational byProportion in tshow $ roundToDigits 2 propDbl tutorialText = case byTutorial of Nothing -> mempty - Just True -> " (T)" - Just False -> " +T " + Just True -> "(T)" + Just False -> "T"