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 #-}
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||||
{-# OPTIONS_GHC -Wwarn #-}
|
|
||||||
|
|
||||||
module Handler.Exam.AutoOccurrence
|
module Handler.Exam.AutoOccurrence
|
||||||
( examAutoOccurrenceCalculateWidget
|
( examAutoOccurrenceCalculateWidget
|
||||||
@ -199,7 +198,6 @@ postEAutoOccurrenceR tid ssh csh examn = do
|
|||||||
|
|
||||||
let calculateRes' = asum $ calculateRes : nudgeRes ^.. folded . _1 . _1 ++ ignoreRes ^.. folded . _1 . _1
|
let calculateRes' = asum $ calculateRes : nudgeRes ^.. folded . _1 . _1 ++ ignoreRes ^.. folded . _1 . _1
|
||||||
|
|
||||||
|
|
||||||
calcResult <- formResultMaybe calculateRes' $ \ExamAutoOccurrenceCalculateForm{..} -> do
|
calcResult <- formResultMaybe calculateRes' $ \ExamAutoOccurrenceCalculateForm{..} -> do
|
||||||
let autoOccurrenceResult = examAutoOccurrence eId examOccurrenceRule eaofConfig occurrences' participants'
|
let autoOccurrenceResult = examAutoOccurrence eId examOccurrenceRule eaofConfig occurrences' participants'
|
||||||
(eaofMapping, eaofAssignment, eaofSuccess) <- case autoOccurrenceResult of
|
(eaofMapping, eaofAssignment, eaofSuccess) <- case autoOccurrenceResult of
|
||||||
|
|||||||
@ -407,8 +407,10 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
|
|||||||
]
|
]
|
||||||
takeEnd n chars = drop (length chars - n) chars
|
takeEnd n chars = drop (length chars - n) chars
|
||||||
in Map.mapKeysWith Set.union (takeEnd . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers
|
in Map.mapKeysWith Set.union (takeEnd . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers
|
||||||
_ | null users-> Map.empty
|
_ | null unassignedUsers -> Map.empty
|
||||||
| otherwise -> Map.singleton [] $ Map.keysSet users
|
| otherwise -> Map.singleton [] $ Map.keysSet unassignedUsers
|
||||||
|
where
|
||||||
|
unassignedUsers = Map.filter (has $ _2 . _Nothing) users
|
||||||
|
|
||||||
occurrencesSize :: ExamOccurrenceCapacity
|
occurrencesSize :: ExamOccurrenceCapacity
|
||||||
occurrencesSize = foldMap' (view _2) occurrences''
|
occurrencesSize = foldMap' (view _2) occurrences''
|
||||||
|
|||||||
Reference in New Issue
Block a user