feat(sheet): warn about no submission without not graded

Fixes #342
This commit is contained in:
Gregor Kleen 2020-09-16 17:21:31 +02:00
parent df3100a85e
commit 937326639a
5 changed files with 20 additions and 4 deletions

View File

@ -368,6 +368,7 @@ SheetWarnNoActiveTo: "Aktiv bis/Ende Abgabezeitraum" sollte stets angegeben werd
SheetNoCurrent: Es gibt momentan kein aktives Übungsblatt. SheetNoCurrent: Es gibt momentan kein aktives Übungsblatt.
SheetNoOldUnassigned: Alle Abgaben inaktiver Blätter sind bereits einen Korrektor zugeteilt. SheetNoOldUnassigned: Alle Abgaben inaktiver Blätter sind bereits einen Korrektor zugeteilt.
SheetsUnassignable name@Text: Momentan keine Abgaben zuteilbar für #{name} SheetsUnassignable name@Text: Momentan keine Abgaben zuteilbar für #{name}
SheetSubmissionModeNoneWithoutNotGraded: Es wurde "Keine Abgabe" eingestellt, jedoch nicht "Keine Bewertung". Kursteilnehmer werden nicht abgeben können.
Deadline: Abgabe Deadline: Abgabe
Done: Eingereicht Done: Eingereicht

View File

@ -367,6 +367,7 @@ SheetWarnNoActiveTo: “Active to/Submission period end” should always be spec
SheetNoCurrent: There is no currently active exercise sheet SheetNoCurrent: There is no currently active exercise sheet
SheetNoOldUnassigned: All submissions for inactive sheets are already assigned to correctors. SheetNoOldUnassigned: All submissions for inactive sheets are already assigned to correctors.
SheetsUnassignable name: Submission for #{name} may not currently be assigned to correctors. SheetsUnassignable name: Submission for #{name} may not currently be assigned to correctors.
SheetSubmissionModeNoneWithoutNotGraded: The sheet was configured to be "No submission" but not "Not marked". Course participants will not be able to submit.
Deadline: Deadline Deadline: Deadline
Done: Submitted Done: Submitted

View File

@ -152,6 +152,10 @@ makeSheetForm cId msId template = identifyForm FIDsheet . validateForm validateS
warnValidation MsgSheetWarnNoActiveTo $ is _Just sfActiveTo || is _Nothing sfActiveFrom warnValidation MsgSheetWarnNoActiveTo $ is _Just sfActiveTo || is _Nothing sfActiveFrom
warnValidation MsgSheetSubmissionModeNoneWithoutNotGraded
$ classifySubmissionMode sfSubmissionMode /= SubmissionModeNone
|| sfType == NotGraded
correctorForm :: Loads -> AForm Handler Loads correctorForm :: Loads -> AForm Handler Loads
correctorForm loads' = wFormToAForm $ do correctorForm loads' = wFormToAForm $ do
currentRoute <- fromMaybe (error "correctorForm called from 404-handler") <$> liftHandler getCurrentRoute currentRoute <- fromMaybe (error "correctorForm called from 404-handler") <$> liftHandler getCurrentRoute

View File

@ -143,6 +143,12 @@ getSShowR tid ssh csh shn = do
E.where_ $ psFile E.^. PersonalisedSheetFileUser E.==. E.val uid E.where_ $ psFile E.^. PersonalisedSheetFileUser E.==. E.val uid
E.&&. psFile E.^. PersonalisedSheetFileSheet E.==. E.val sid E.&&. psFile E.^. PersonalisedSheetFileSheet E.==. E.val sid
submissionModeNoneWithoutNotGradedWarning <- runMaybeT $ do
guard $ classifySubmissionMode (sheetSubmissionMode sheet) == SubmissionModeNone
&& sheetType sheet /= NotGraded
guardM . hasWriteAccessTo $ CSheetR tid ssh csh shn SEditR
return $ notification NotificationBroad =<< messageI Warning MsgSheetSubmissionModeNoneWithoutNotGraded
defaultLayout $ do defaultLayout $ do
setTitleI $ prependCourseTitle tid ssh csh $ SomeMessage shn setTitleI $ prependCourseTitle tid ssh csh $ SomeMessage shn
let zipLink = CSheetR tid ssh csh shn SArchiveR let zipLink = CSheetR tid ssh csh shn SArchiveR

View File

@ -1,4 +1,7 @@
$newline never $newline never
$maybe warn <- submissionModeNoneWithoutNotGradedWarning
^{warn}
$maybe descr <- sheetDescription sheet $maybe descr <- sheetDescription sheet
<section> <section>
<h2 #description>_{MsgSheetDescription} <h2 #description>_{MsgSheetDescription}
@ -19,10 +22,11 @@ $maybe descr <- sheetDescription sheet
_{MsgSheetActiveFromParticipant} _{MsgSheetActiveFromParticipant}
$else $else
_{MsgSheetActiveFromParticipantNoSubmit} _{MsgSheetActiveFromParticipantNoSubmit}
$maybe ts <- sheetFrom <dd .deflist__dd>
<dd .deflist__dd>#{ts} $maybe ts <- sheetFrom
$nothing #{ts}
<dd .deflist__dd>_{MsgSheetActiveFromUnset} $nothing
_{MsgSheetActiveFromUnset}
$if hasSubmission $if hasSubmission
<dt .deflist__dt>_{MsgSheetActiveToParticipant} <dt .deflist__dt>_{MsgSheetActiveToParticipant}
$maybe ts <- sheetTo $maybe ts <- sheetTo