diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index 640a791f4..ff7a2f644 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -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 diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 372c993ee..5a28dab5c 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -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 diff --git a/src/Handler/Sheet/Form.hs b/src/Handler/Sheet/Form.hs index 2705f7762..23f80effa 100644 --- a/src/Handler/Sheet/Form.hs +++ b/src/Handler/Sheet/Form.hs @@ -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 diff --git a/src/Handler/Sheet/Show.hs b/src/Handler/Sheet/Show.hs index 00f38c092..e4dea05ad 100644 --- a/src/Handler/Sheet/Show.hs +++ b/src/Handler/Sheet/Show.hs @@ -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 diff --git a/templates/sheetShow.hamlet b/templates/sheetShow.hamlet index a6868a364..03bf14fdf 100644 --- a/templates/sheetShow.hamlet +++ b/templates/sheetShow.hamlet @@ -1,4 +1,7 @@ $newline never +$maybe warn <- submissionModeNoneWithoutNotGradedWarning + ^{warn} + $maybe descr <- sheetDescription sheet

_{MsgSheetDescription} @@ -19,10 +22,11 @@ $maybe descr <- sheetDescription sheet _{MsgSheetActiveFromParticipant} $else _{MsgSheetActiveFromParticipantNoSubmit} - $maybe ts <- sheetFrom -
#{ts} - $nothing -
_{MsgSheetActiveFromUnset} +
+ $maybe ts <- sheetFrom + #{ts} + $nothing + _{MsgSheetActiveFromUnset} $if hasSubmission
_{MsgSheetActiveToParticipant} $maybe ts <- sheetTo