fix: oops

This commit is contained in:
Wolfgang Witt 2021-03-17 17:10:16 +01:00 committed by Gregor Kleen
parent a35a481f33
commit f6cbf99245
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ examAutoOccurrenceCalculateForm ExamAutoOccurrenceCalculateForm{ eaofConfig }
automaticIfTrue False = EAOIRManual Set.empty
ignoreRooms :: ExamAutoOccurrenceIgnoreRooms -> Bool
ignoreRooms EAOIRAutomatic = True
ignoreRooms (EAOIRManual s) = null s
ignoreRooms (EAOIRManual s) = not $ null s
examAutoOccurrenceNudgeForm :: ExamOccurrenceId -> Maybe ExamAutoOccurrenceCalculateForm -> Form ExamAutoOccurrenceCalculateForm
examAutoOccurrenceNudgeForm occId protoForm html = do

View File

@ -413,7 +413,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
-- If a single occurrence can accommodate all participants, pick the one with
-- the least capacity
(occurrences'', ignoredOccurrences) = case eaocIgnoreRooms of
(EAOIRManual manuallyIgnored) -> (Map.toList $ Map.restrictKeys occurrences' manuallyIgnored, manuallyIgnored)
(EAOIRManual manuallyIgnored) -> (Map.toList $ Map.withoutKeys occurrences' manuallyIgnored, manuallyIgnored)
EAOIRAutomatic -- effect of ticked minimizeRooms Checkbox
| Just largeEnoughs <- fromNullable . filter ((>= Restricted usersCount) . view _2) $ Map.toList occurrences'
-> let pickedLargeEnough = minimumBy (comparing $ view _2) largeEnoughs