feat(submissions): Apply suggestions to reduce lines of code

This commit is contained in:
Sarah Vaupel 2022-02-07 20:26:21 +01:00
parent 880eb3b1ad
commit 2f1ecd3979
3 changed files with 5 additions and 15 deletions

View File

@ -160,8 +160,7 @@ SubmissionDownloadGroups: Mit festen Abgabegruppen
CorrAutoSetCorrector: Korrekturen verteilen
CorrDelete: Abgaben löschen
CorrSetCorrectionsDone: Korrekturen als abgeschlossen markieren
SetCorrectionsDoneTrue: Korrekturen als abgeschlossen markiert
SetCorrectionsDoneFalse: Korrekturen als nicht abgeschlossen markiert
SetCorrectionsDone b@Bool: Korrekturen als #{bool "nicht" "" b} abgeschlossen markiert
SubmissionCorrected: Korrigiert
CorrectionSheets: Übersicht Korrekturen nach Blättern
CorrectionCorrectors: Übersicht Korrekturen nach Korrektor:innen

View File

@ -160,8 +160,7 @@ SubmissionDownloadGroups: With registered submission groups
CorrAutoSetCorrector: Distribute corrections
CorrDelete: Delete submissions
CorrSetCorrectionsDone: Set corrections as done
SetCorrectionsDoneTrue: Set corrections as done
SetCorrectionsDoneFalse: Set corrections as not done
SetCorrectionsDone b: Set corrections as #{bool "not" "" b} done
SubmissionCorrected: Marked
CorrectionSheets: Corrections by sheet
CorrectionCorrectors: Corrections by corrector

View File

@ -929,21 +929,13 @@ correctionsR' whereClause displayColumns dbtFilterUI csvSettings psValidator act
unassigned' <- forM (Set.toList stillUnassigned) $ \sid -> encrypt sid :: DB CryptoFileNameSubmission
addMessage Warning =<< withUrlRenderer ($(ihamletFile "templates/messages/submissionsNotAssignedAuto.hamlet") mr)
redirect currentRoute
(CorrSetCorrectionsDoneData True, subs') -> do
subs <- mapM decrypt $ Set.toList subs'
(CorrSetCorrectionsDoneData isDone, subs') -> do
now <- liftIO getCurrentTime
runDB $ do
_ <- updateWhere [SubmissionId <-. subs]
[SubmissionRatingTime =. Just now]
addMessageI Success $ MsgSetCorrectionsDoneTrue
auditAllSubEdit subs
redirect currentRoute
(CorrSetCorrectionsDoneData False, subs') -> do
subs <- mapM decrypt $ Set.toList subs'
runDB $ do
_ <- updateWhere [SubmissionId <-. subs]
[SubmissionRatingTime =. Nothing]
addMessageI Success $ MsgSetCorrectionsDoneFalse
[SubmissionRatingTime =. bool Nothing (Just now) isDone]
addMessageI Success $ MsgSetCorrectionsDone isDone
auditAllSubEdit subs
redirect currentRoute
(CorrDeleteData, subs) -> do