diff --git a/src/Handler/Exam/AutoOccurrence.hs b/src/Handler/Exam/AutoOccurrence.hs index 933fd3db3..a1e10a38e 100644 --- a/src/Handler/Exam/AutoOccurrence.hs +++ b/src/Handler/Exam/AutoOccurrence.hs @@ -1,5 +1,4 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# OPTIONS_GHC -Wwarn #-} module Handler.Exam.AutoOccurrence ( examAutoOccurrenceCalculateWidget @@ -199,7 +198,6 @@ postEAutoOccurrenceR tid ssh csh examn = do let calculateRes' = asum $ calculateRes : nudgeRes ^.. folded . _1 . _1 ++ ignoreRes ^.. folded . _1 . _1 - calcResult <- formResultMaybe calculateRes' $ \ExamAutoOccurrenceCalculateForm{..} -> do let autoOccurrenceResult = examAutoOccurrence eId examOccurrenceRule eaofConfig occurrences' participants' (eaofMapping, eaofAssignment, eaofSuccess) <- case autoOccurrenceResult of diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index 324fd5498..4416b7fa6 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -407,8 +407,10 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences ] takeEnd n chars = drop (length chars - n) chars in Map.mapKeysWith Set.union (takeEnd . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers - _ | null users-> Map.empty - | otherwise -> Map.singleton [] $ Map.keysSet users + _ | null unassignedUsers -> Map.empty + | otherwise -> Map.singleton [] $ Map.keysSet unassignedUsers + where + unassignedUsers = Map.filter (has $ _2 . _Nothing) users occurrencesSize :: ExamOccurrenceCapacity occurrencesSize = foldMap' (view _2) occurrences''