diff --git a/src/Handler/Corrections.hs b/src/Handler/Corrections.hs index a251ddf56..eb9be55a3 100644 --- a/src/Handler/Corrections.hs +++ b/src/Handler/Corrections.hs @@ -1134,6 +1134,7 @@ assignHandler tid ssh csh cid assignSids = do return (corrector, user) let correctorMap :: Map UserId (SheetCorrector,User) correctorMap = foldl (\m (Entity _ corr, Entity uid user)-> Map.insert uid (corr,user) m) Map.empty correctors + -- TODO: CorrectorMap should contain Map SheetId SheetCorrector submissions <- E.select . E.from $ \submission -> do E.where_ $ submission E.^. SubmissionSheet `E.in_` E.valList sheetIds @@ -1187,11 +1188,8 @@ assignHandler tid ssh csh cid assignSids = do (Just BtnSubmissionsAssign) -> writeSubmissionPlan plan return $ Map.insert shn (status, countMapElems plan) acc assignment <- foldM buildA Map.empty assignSids - return (nrParticipants, groupsPossible, infoMap, correctorMap, assignment) - - let -- create aggregate maps sheetMap :: Map SheetName CorrectionInfo sheetMap = Map.map fold infoMap @@ -1209,8 +1207,8 @@ assignHandler tid ssh csh cid assignSids = do showAvgsDays :: Maybe NominalDiffTime -> Integer -> Text showAvgsDays Nothing _ = mempty showAvgsDays (Just dt) n = formatDiffDays $ dt / fromIntegral n - heat :: Double -> Double -> Double - heat achieved full = roundToDigits 3 $ cutOffPercent 0.4 full achieved + heat :: Integer -> Integer -> Double + heat full achieved = roundToDigits 3 $ cutOffPercent 0.4 (fromIntegral full) (fromIntegral achieved) let headingShort = MsgMenuCorrectionsAssign headingLong = prependCourseTitle tid ssh csh MsgMenuCorrectionsAssign siteLayoutMsg headingShort $ do diff --git a/templates/corrections-overview.hamlet b/templates/corrections-overview.hamlet index 595b28a80..88deec48a 100644 --- a/templates/corrections-overview.hamlet +++ b/templates/corrections-overview.hamlet @@ -41,7 +41,7 @@ ^{showCorrector ciCorrector} #{ciSubmissions} - #{ciSubmissions - ciCorrected} + #{ciSubmissions - ciCorrected} #{showDiffDays ciMin} #{showAvgsDays ciTot ciCorrected} #{showDiffDays ciMax} @@ -52,7 +52,7 @@ $maybe nrNew <- Map.lookup ciCorrector cass #{ciAssigned} (+#{nrNew}) - #{ciAssigned - ciCorrected} + #{ciAssigned - ciCorrected} #{showAvgsDays ciTot ciCorrected} $nothing #{ciAssigned}