diff --git a/src/Handler/Utils/Submission.hs b/src/Handler/Utils/Submission.hs index a397041a8..124da1b83 100644 --- a/src/Handler/Utils/Submission.hs +++ b/src/Handler/Utils/Submission.hs @@ -130,7 +130,9 @@ assignSubmissions sid restriction = do props = getSum $ foldMap (Sum . fst) assignments toDeficit' (prop, assigned) = let - target = round $ fromInteger assigned' * (prop / props) + target + | props == 0 = 0 + | otherwise = round $ fromInteger assigned' * (prop / props) in target - assigned $logDebugS "assignSubmissions" $ "Previous submissions: " <> tshow prevSubs'