fix: correctly report NoUsers for ExamRoomRandom
preselection was ignored for the check so far
This commit is contained in:
parent
e00a2b074b
commit
16cbc78878
@ -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
|
||||
|
||||
@ -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''
|
||||
|
||||
Loading…
Reference in New Issue
Block a user