From 8201aa84e5e2328c0e229c776dd035125fcac6b1 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Mon, 17 Jun 2019 08:33:15 +0200 Subject: [PATCH] Bugfix: only attemp to assign unassigned submissions --- src/Handler/Corrections.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Handler/Corrections.hs b/src/Handler/Corrections.hs index eb9be55a3..58e775dea 100644 --- a/src/Handler/Corrections.hs +++ b/src/Handler/Corrections.hs @@ -1171,8 +1171,9 @@ assignHandler tid ssh csh cid assignSids = do -- is sheet closed? guardM $ lift $ hasWriteAccessTo $ CSheetR tid ssh csh shn SAssignR -- we must check, whether the submission is already closed and thus assignable -- has at least one submisison? - [E.Value hasSubmission] <- lift $ E.select $ return $ E.exists $ E.from $ \submission -> + [E.Value hasSubmission] <- lift $ E.select $ return $ E.exists $ E.from $ \submission -> do E.where_ $ submission E.^. SubmissionSheet E.==. E.val sid + E.where_ $ E.isNothing $ submission E.^. SubmissionRatingBy guard hasSubmission -- has at least one active corrector? [E.Value hasCorrector] <- lift $ E.select $ return $ E.exists $ E.from $ \corrector -> do