Merge branch '342-ubungsblatt-anlegen-sollte-warnung-ausgeben-wenn-keine-abgabe-aber-nicht-keine-bewertung' into 'master'

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

Closes #342

See merge request uni2work/uni2work!28
This commit is contained in:
Gregor Kleen 2020-09-16 19:09:38 +02:00
commit 5f65bb5901
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.
SheetNoOldUnassigned: Alle Abgaben inaktiver Blätter sind bereits einen Korrektor zugeteilt.
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
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
SheetNoOldUnassigned: All submissions for inactive sheets are already 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
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 MsgSheetSubmissionModeNoneWithoutNotGraded
$ classifySubmissionMode sfSubmissionMode /= SubmissionModeNone
|| sfType == NotGraded
correctorForm :: Loads -> AForm Handler Loads
correctorForm loads' = wFormToAForm $ do
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.&&. 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
setTitleI $ prependCourseTitle tid ssh csh $ SomeMessage shn
let zipLink = CSheetR tid ssh csh shn SArchiveR

View File

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