Avoid divide by zero
This commit is contained in:
parent
78fc27dc04
commit
2bea5435bf
@ -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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user