diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index 9a63a6ac3..a3cf09c7f 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -417,7 +417,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences ignoredOccurrences :: ExamAutoOccurrenceIgnoreRooms -- ^ will always be EAOIRManual with eaoirSorted noting if occurrences were downwards sorted by size (occurrences'', ignoredOccurrences) = case eaocIgnoreRooms of - EAOIRManual {..} -> ((if eaoirmSorted then sortOn (Down . view _2) else id) $ Map.toList $ Map.withoutKeys occurrences' eaoirmIgnored, eaocIgnoreRooms) + EAOIRManual {..} -> ((if eaoirmSorted then sortOn (view _2) else id) $ Map.toList $ Map.withoutKeys occurrences' eaoirmIgnored, eaocIgnoreRooms) EAOIRAutomatic -- effect of ticked minimizeRooms Checkbox | Just largeEnoughs <- fromNullable . filter ((>= Restricted usersCount) . view _2) $ Map.toList occurrences' -> let pickedLargeEnough = minimumBy (comparing $ view _2) largeEnoughs @@ -467,6 +467,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences where restrictedLines :: [(lineId, Natural)] unrestrictedLines :: [lineId] + -- partitionRestricted reverses the order of occurrences (unrestrictedLines, restrictedLines) = partitionRestricted ([], []) lineLengths -- reorder so unrestricted lines are at the end and my be left empty