diff --git a/src/Handler/Utils/Submission.hs b/src/Handler/Utils/Submission.hs index 2e866c46f..06f8ec024 100644 --- a/src/Handler/Utils/Submission.hs +++ b/src/Handler/Utils/Submission.hs @@ -166,7 +166,7 @@ assignSubmissions sid restriction = do $logDebugS "assignSubmissions" $ "Deterministic Queue: " <> tshow detQueue queue <- liftIO . Rand.evalRandIO . execWriterT $ do - tell . map Just =<< Rand.shuffleM detQueue + tell $ map Just detQueue forever $ tell . pure =<< Rand.weightedMay [ (sheetCorrectorUser, byProportion sheetCorrectorLoad) | Entity _ SheetCorrector{..} <- corrsProp ] @@ -184,8 +184,10 @@ assignSubmissions sid restriction = do maximumDeficit = do transposed <- uses _3 invertMap traverse (liftIO . Rand.evalRandIO . Rand.uniform . snd) (Map.lookupMax transposed) + + subTutor'' <- liftIO . Rand.evalRandIO . Rand.shuffleM $ Map.toList subTutor' - subTutor <- fmap (view _1) . flip execStateT (Map.empty, queue, deficit) . forM_ (Map.toList subTutor') $ \(smid, tuts) -> do + subTutor <- fmap (view _1) . flip execStateT (Map.empty, queue, deficit) . forM_ subTutor'' $ \(smid, tuts) -> do let restrictTuts | Set.null tuts = id