From fabf56c1640c94f806d43aaca264100cbc39b840 Mon Sep 17 00:00:00 2001 From: Wolfgang Witt Date: Thu, 18 Mar 2021 14:51:50 +0100 Subject: [PATCH] fix: check space of occurrences after ignoring --- src/Handler/Utils/Exam.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index 596700220..9a63a6ac3 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -45,6 +45,7 @@ import qualified Data.Array as Array import Data.Array.ST (STArray, STUArray) import qualified Data.Array.ST as ST +import Data.Foldable (foldMap') import Data.List (findIndex, unfoldr) import qualified Data.List as List @@ -392,7 +393,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences | otherwise -> Map.singleton [] $ Map.keysSet users occurrencesSize :: ExamOccurrenceCapacity - occurrencesSize = fold occurrences' + occurrencesSize = foldMap' (view _2) occurrences'' occurrences' :: Map ExamOccurrenceId ExamOccurrenceCapacity -- ^ reduce room capacity for every pre-assigned user by 1