fix: oops
This commit is contained in:
parent
a35a481f33
commit
f6cbf99245
@ -62,7 +62,7 @@ examAutoOccurrenceCalculateForm ExamAutoOccurrenceCalculateForm{ eaofConfig }
|
|||||||
automaticIfTrue False = EAOIRManual Set.empty
|
automaticIfTrue False = EAOIRManual Set.empty
|
||||||
ignoreRooms :: ExamAutoOccurrenceIgnoreRooms -> Bool
|
ignoreRooms :: ExamAutoOccurrenceIgnoreRooms -> Bool
|
||||||
ignoreRooms EAOIRAutomatic = True
|
ignoreRooms EAOIRAutomatic = True
|
||||||
ignoreRooms (EAOIRManual s) = null s
|
ignoreRooms (EAOIRManual s) = not $ null s
|
||||||
|
|
||||||
examAutoOccurrenceNudgeForm :: ExamOccurrenceId -> Maybe ExamAutoOccurrenceCalculateForm -> Form ExamAutoOccurrenceCalculateForm
|
examAutoOccurrenceNudgeForm :: ExamOccurrenceId -> Maybe ExamAutoOccurrenceCalculateForm -> Form ExamAutoOccurrenceCalculateForm
|
||||||
examAutoOccurrenceNudgeForm occId protoForm html = do
|
examAutoOccurrenceNudgeForm occId protoForm html = do
|
||||||
|
|||||||
@ -413,7 +413,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
|
|||||||
-- If a single occurrence can accommodate all participants, pick the one with
|
-- If a single occurrence can accommodate all participants, pick the one with
|
||||||
-- the least capacity
|
-- the least capacity
|
||||||
(occurrences'', ignoredOccurrences) = case eaocIgnoreRooms of
|
(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
|
EAOIRAutomatic -- effect of ticked minimizeRooms Checkbox
|
||||||
| Just largeEnoughs <- fromNullable . filter ((>= Restricted usersCount) . view _2) $ Map.toList occurrences'
|
| Just largeEnoughs <- fromNullable . filter ((>= Restricted usersCount) . view _2) $ Map.toList occurrences'
|
||||||
-> let pickedLargeEnough = minimumBy (comparing $ view _2) largeEnoughs
|
-> let pickedLargeEnough = minimumBy (comparing $ view _2) largeEnoughs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user