feat(submissions): add option 'Set corrections as done'
This commit is contained in:
parent
59fd22a010
commit
880eb3b1ad
@ -159,6 +159,9 @@ SubmissionDownloadMatriculations: Mit Matrikelnummern
|
||||
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
|
||||
SubmissionCorrected: Korrigiert
|
||||
CorrectionSheets: Übersicht Korrekturen nach Blättern
|
||||
CorrectionCorrectors: Übersicht Korrekturen nach Korrektor:innen
|
||||
@ -262,4 +265,4 @@ CorrectionTableCsvSheetNameCourseCorrections tid@TermId ssh@SchoolId csh@CourseS
|
||||
CorrectionTableCsvNameCorrections: abgaben
|
||||
CorrectionTableCsvSheetNameCorrections: Abgaben
|
||||
CorrectionTableCsvNameCourseUserCorrections tid@TermId ssh@SchoolId csh@CourseShorthand displayName@Text: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)}-#{foldedCase csh}-#{foldCase displayName}-abgaben
|
||||
CorrectionTableCsvSheetNameCourseUserCorrections tid@TermId ssh@SchoolId csh@CourseShorthand displayName@Text: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)}-#{foldedCase csh}-#{foldCase displayName} Abgaben
|
||||
CorrectionTableCsvSheetNameCourseUserCorrections tid@TermId ssh@SchoolId csh@CourseShorthand displayName@Text: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)}-#{foldedCase csh}-#{foldCase displayName} Abgaben
|
||||
|
||||
@ -159,6 +159,9 @@ SubmissionDownloadMatriculations: With matriculation numbers
|
||||
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
|
||||
SubmissionCorrected: Marked
|
||||
CorrectionSheets: Corrections by sheet
|
||||
CorrectionCorrectors: Corrections by corrector
|
||||
|
||||
@ -781,6 +781,7 @@ makeCorrectionsTable whereClause dbtColonnade dbtFilterUI' mCSVSettings psValida
|
||||
data ActionCorrections = CorrDownload
|
||||
| CorrSetCorrector
|
||||
| CorrAutoSetCorrector
|
||||
| CorrSetCorrectionsDone
|
||||
| CorrDelete
|
||||
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
||||
|
||||
@ -793,6 +794,7 @@ embedRenderMessage ''UniWorX ''ActionCorrections id
|
||||
data ActionCorrectionsData = CorrDownloadData SubmissionDownloadAnonymous SubmissionFileType
|
||||
| CorrSetCorrectorData (Maybe UserId)
|
||||
| CorrAutoSetCorrectorData SheetId
|
||||
| CorrSetCorrectionsDoneData Bool
|
||||
| CorrDeleteData
|
||||
|
||||
correctionsR :: CorrectionTableWhere -> _ -> _ -> Maybe CorrectionTableCsvSettings -> _ -> Map ActionCorrections (AForm (HandlerFor UniWorX) ActionCorrectionsData) -> Handler TypedContent
|
||||
@ -927,6 +929,23 @@ 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'
|
||||
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
|
||||
auditAllSubEdit subs
|
||||
redirect currentRoute
|
||||
(CorrDeleteData, subs) -> do
|
||||
subs' <- Set.fromList <$> forM (Set.toList subs) decrypt -- Set is not traversable
|
||||
getDeleteR (submissionDeleteRoute subs')
|
||||
@ -997,6 +1016,12 @@ assignAction selId = ( CorrSetCorrector
|
||||
fmap CorrSetCorrectorData <$> (traverse.traverse) decrypt cId
|
||||
)
|
||||
|
||||
setCorrectionsDoneAction :: ActionCorrections'
|
||||
setCorrectionsDoneAction = ( CorrSetCorrectionsDone
|
||||
, CorrSetCorrectionsDoneData
|
||||
<$> apopt checkBoxField (fslI MsgCorrSetCorrectionsDone) (Just True)
|
||||
)
|
||||
|
||||
autoAssignAction :: SheetId -> ActionCorrections'
|
||||
autoAssignAction shid = ( CorrAutoSetCorrector
|
||||
, pure $ CorrAutoSetCorrectorData shid
|
||||
@ -1109,6 +1134,7 @@ postCCorrectionsR tid ssh csh = do
|
||||
correctionsR whereClause colonnade filterUI csvSettings psValidator $ Map.fromList
|
||||
[ downloadAction
|
||||
, assignAction (Left cid)
|
||||
, setCorrectionsDoneAction
|
||||
, deleteAction
|
||||
]
|
||||
|
||||
@ -1157,5 +1183,6 @@ postSSubsR tid ssh csh shn = do
|
||||
[ downloadAction
|
||||
, assignAction (Right shid)
|
||||
, autoAssignAction shid
|
||||
, setCorrectionsDoneAction
|
||||
, deleteAction
|
||||
]
|
||||
|
||||
2
testdata/workflows
vendored
2
testdata/workflows
vendored
@ -1 +1 @@
|
||||
Subproject commit d567d2957cd2a53fb79d2b60e650236509ffe726
|
||||
Subproject commit 1a788c67fe98cadf1e29b0e328072437955fd660
|
||||
Reference in New Issue
Block a user