Merge branch '616-mehr-aktionen-auf-ssubsr' into 'master'
feat(submissions): add option 'Set corrections as done' Closes #616 See merge request uni2work/uni2work!76
This commit is contained in:
commit
596ef4ff07
@ -159,6 +159,8 @@ SubmissionDownloadMatriculations: Mit Matrikelnummern
|
|||||||
SubmissionDownloadGroups: Mit festen Abgabegruppen
|
SubmissionDownloadGroups: Mit festen Abgabegruppen
|
||||||
CorrAutoSetCorrector: Korrekturen verteilen
|
CorrAutoSetCorrector: Korrekturen verteilen
|
||||||
CorrDelete: Abgaben löschen
|
CorrDelete: Abgaben löschen
|
||||||
|
CorrSetCorrectionsDone: Korrekturen als abgeschlossen markieren
|
||||||
|
SetCorrectionsDone b@Bool: Korrekturen als #{notDE b} abgeschlossen markiert
|
||||||
SubmissionCorrected: Korrigiert
|
SubmissionCorrected: Korrigiert
|
||||||
CorrectionSheets: Übersicht Korrekturen nach Blättern
|
CorrectionSheets: Übersicht Korrekturen nach Blättern
|
||||||
CorrectionCorrectors: Übersicht Korrekturen nach Korrektor:innen
|
CorrectionCorrectors: Übersicht Korrekturen nach Korrektor:innen
|
||||||
@ -262,4 +264,4 @@ CorrectionTableCsvSheetNameCourseCorrections tid@TermId ssh@SchoolId csh@CourseS
|
|||||||
CorrectionTableCsvNameCorrections: abgaben
|
CorrectionTableCsvNameCorrections: abgaben
|
||||||
CorrectionTableCsvSheetNameCorrections: Abgaben
|
CorrectionTableCsvSheetNameCorrections: Abgaben
|
||||||
CorrectionTableCsvNameCourseUserCorrections tid@TermId ssh@SchoolId csh@CourseShorthand displayName@Text: #{foldCase (termToText (unTermKey tid))}-#{foldedCase (unSchoolKey ssh)}-#{foldedCase csh}-#{foldCase displayName}-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,8 @@ SubmissionDownloadMatriculations: With matriculation numbers
|
|||||||
SubmissionDownloadGroups: With registered submission groups
|
SubmissionDownloadGroups: With registered submission groups
|
||||||
CorrAutoSetCorrector: Distribute corrections
|
CorrAutoSetCorrector: Distribute corrections
|
||||||
CorrDelete: Delete submissions
|
CorrDelete: Delete submissions
|
||||||
|
CorrSetCorrectionsDone: Set corrections as done
|
||||||
|
SetCorrectionsDone b: Set corrections as #{notEN b} done
|
||||||
SubmissionCorrected: Marked
|
SubmissionCorrected: Marked
|
||||||
CorrectionSheets: Corrections by sheet
|
CorrectionSheets: Corrections by sheet
|
||||||
CorrectionCorrectors: Corrections by corrector
|
CorrectionCorrectors: Corrections by corrector
|
||||||
|
|||||||
@ -142,6 +142,11 @@ ordinalEN (toMessage -> numStr) = case lastChar of
|
|||||||
where
|
where
|
||||||
lastChar = last <$> fromNullable numStr
|
lastChar = last <$> fromNullable numStr
|
||||||
|
|
||||||
|
notDE :: Bool -> Text
|
||||||
|
notDE = bool "nicht" ""
|
||||||
|
|
||||||
|
notEN :: Bool -> Text
|
||||||
|
notEN = bool "not" ""
|
||||||
|
|
||||||
-- | Convenience function for i18n messages definitions
|
-- | Convenience function for i18n messages definitions
|
||||||
maybeToMessage :: ToMessage m => Text -> Maybe m -> Text -> Text
|
maybeToMessage :: ToMessage m => Text -> Maybe m -> Text -> Text
|
||||||
|
|||||||
@ -781,6 +781,7 @@ makeCorrectionsTable whereClause dbtColonnade dbtFilterUI' mCSVSettings psValida
|
|||||||
data ActionCorrections = CorrDownload
|
data ActionCorrections = CorrDownload
|
||||||
| CorrSetCorrector
|
| CorrSetCorrector
|
||||||
| CorrAutoSetCorrector
|
| CorrAutoSetCorrector
|
||||||
|
| CorrSetCorrectionsDone
|
||||||
| CorrDelete
|
| CorrDelete
|
||||||
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
deriving (Eq, Ord, Read, Show, Enum, Bounded)
|
||||||
|
|
||||||
@ -793,6 +794,7 @@ embedRenderMessage ''UniWorX ''ActionCorrections id
|
|||||||
data ActionCorrectionsData = CorrDownloadData SubmissionDownloadAnonymous SubmissionFileType
|
data ActionCorrectionsData = CorrDownloadData SubmissionDownloadAnonymous SubmissionFileType
|
||||||
| CorrSetCorrectorData (Maybe UserId)
|
| CorrSetCorrectorData (Maybe UserId)
|
||||||
| CorrAutoSetCorrectorData SheetId
|
| CorrAutoSetCorrectorData SheetId
|
||||||
|
| CorrSetCorrectionsDoneData Bool
|
||||||
| CorrDeleteData
|
| CorrDeleteData
|
||||||
|
|
||||||
correctionsR :: CorrectionTableWhere -> _ -> _ -> Maybe CorrectionTableCsvSettings -> _ -> Map ActionCorrections (AForm (HandlerFor UniWorX) ActionCorrectionsData) -> Handler TypedContent
|
correctionsR :: CorrectionTableWhere -> _ -> _ -> Maybe CorrectionTableCsvSettings -> _ -> Map ActionCorrections (AForm (HandlerFor UniWorX) ActionCorrectionsData) -> Handler TypedContent
|
||||||
@ -927,6 +929,15 @@ correctionsR' whereClause displayColumns dbtFilterUI csvSettings psValidator act
|
|||||||
unassigned' <- forM (Set.toList stillUnassigned) $ \sid -> encrypt sid :: DB CryptoFileNameSubmission
|
unassigned' <- forM (Set.toList stillUnassigned) $ \sid -> encrypt sid :: DB CryptoFileNameSubmission
|
||||||
addMessage Warning =<< withUrlRenderer ($(ihamletFile "templates/messages/submissionsNotAssignedAuto.hamlet") mr)
|
addMessage Warning =<< withUrlRenderer ($(ihamletFile "templates/messages/submissionsNotAssignedAuto.hamlet") mr)
|
||||||
redirect currentRoute
|
redirect currentRoute
|
||||||
|
(CorrSetCorrectionsDoneData isDone, subs') -> do
|
||||||
|
now <- liftIO getCurrentTime
|
||||||
|
subs <- mapM decrypt $ Set.toList subs'
|
||||||
|
runDB $ do
|
||||||
|
_ <- updateWhere [SubmissionId <-. subs]
|
||||||
|
[SubmissionRatingTime =. bool Nothing (Just now) isDone]
|
||||||
|
addMessageI Success $ MsgSetCorrectionsDone isDone
|
||||||
|
auditAllSubEdit subs
|
||||||
|
redirect currentRoute
|
||||||
(CorrDeleteData, subs) -> do
|
(CorrDeleteData, subs) -> do
|
||||||
subs' <- Set.fromList <$> forM (Set.toList subs) decrypt -- Set is not traversable
|
subs' <- Set.fromList <$> forM (Set.toList subs) decrypt -- Set is not traversable
|
||||||
getDeleteR (submissionDeleteRoute subs')
|
getDeleteR (submissionDeleteRoute subs')
|
||||||
@ -997,6 +1008,12 @@ assignAction selId = ( CorrSetCorrector
|
|||||||
fmap CorrSetCorrectorData <$> (traverse.traverse) decrypt cId
|
fmap CorrSetCorrectorData <$> (traverse.traverse) decrypt cId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
setCorrectionsDoneAction :: ActionCorrections'
|
||||||
|
setCorrectionsDoneAction = ( CorrSetCorrectionsDone
|
||||||
|
, CorrSetCorrectionsDoneData
|
||||||
|
<$> apopt checkBoxField (fslI MsgCorrSetCorrectionsDone) (Just True)
|
||||||
|
)
|
||||||
|
|
||||||
autoAssignAction :: SheetId -> ActionCorrections'
|
autoAssignAction :: SheetId -> ActionCorrections'
|
||||||
autoAssignAction shid = ( CorrAutoSetCorrector
|
autoAssignAction shid = ( CorrAutoSetCorrector
|
||||||
, pure $ CorrAutoSetCorrectorData shid
|
, pure $ CorrAutoSetCorrectorData shid
|
||||||
@ -1109,6 +1126,7 @@ postCCorrectionsR tid ssh csh = do
|
|||||||
correctionsR whereClause colonnade filterUI csvSettings psValidator $ Map.fromList
|
correctionsR whereClause colonnade filterUI csvSettings psValidator $ Map.fromList
|
||||||
[ downloadAction
|
[ downloadAction
|
||||||
, assignAction (Left cid)
|
, assignAction (Left cid)
|
||||||
|
, setCorrectionsDoneAction
|
||||||
, deleteAction
|
, deleteAction
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1157,5 +1175,6 @@ postSSubsR tid ssh csh shn = do
|
|||||||
[ downloadAction
|
[ downloadAction
|
||||||
, assignAction (Right shid)
|
, assignAction (Right shid)
|
||||||
, autoAssignAction shid
|
, autoAssignAction shid
|
||||||
|
, setCorrectionsDoneAction
|
||||||
, deleteAction
|
, deleteAction
|
||||||
]
|
]
|
||||||
|
|||||||
@ -30,6 +30,7 @@ $newline never
|
|||||||
<li>Felix Hamann (Frontend)
|
<li>Felix Hamann (Frontend)
|
||||||
<li>Steffen Jost
|
<li>Steffen Jost
|
||||||
<li>Gregor Kleen
|
<li>Gregor Kleen
|
||||||
|
<li>Luca Maio
|
||||||
<li>Winnie Ros
|
<li>Winnie Ros
|
||||||
<li>Sarah Vaupel
|
<li>Sarah Vaupel
|
||||||
<li>Wolfgang Witt
|
<li>Wolfgang Witt
|
||||||
|
|||||||
@ -29,6 +29,7 @@ $newline never
|
|||||||
<li>Felix Hamann (Frontend)
|
<li>Felix Hamann (Frontend)
|
||||||
<li>Steffen Jost
|
<li>Steffen Jost
|
||||||
<li>Gregor Kleen
|
<li>Gregor Kleen
|
||||||
|
<li>Luca Maio
|
||||||
<li>Winnie Ros
|
<li>Winnie Ros
|
||||||
<li>Sarah Vaupel
|
<li>Sarah Vaupel
|
||||||
<li>Wolfgang Witt
|
<li>Wolfgang Witt
|
||||||
|
|||||||
2
testdata/workflows
vendored
2
testdata/workflows
vendored
@ -1 +1 @@
|
|||||||
Subproject commit d567d2957cd2a53fb79d2b60e650236509ffe726
|
Subproject commit 1a788c67fe98cadf1e29b0e328072437955fd660
|
||||||
Reference in New Issue
Block a user