diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index 25cf5740d..ec8136171 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -160,14 +160,15 @@ examForm (Entity _ Course{..}) template csrf = hoist liftHandler $ do (maybe mempty (authorshipStatementDefinitionContent . entityVal) mSchoolAuthorshipStatement) contentField ttipReq = bool forcedContentField (reqContentField ttipReq) schoolSheetExamAuthorshipStatementAllowOther in case schoolSheetExamAuthorshipStatementMode of - SchoolAuthorshipStatementModeNone -> pure Nothing - SchoolAuthorshipStatementModeOptional -> aformSection MsgExamAuthorshipStatementSection - *> optionalActionA - (contentField id) - (fslI MsgExamAuthorshipStatementRequired & setTooltip MsgExamAuthorshipStatementRequiredTip) - ((is _Just . efAuthorshipStatement <$> template) <|> (pure $ is _Just schoolSheetExamAuthorshipStatementDefinition)) - SchoolAuthorshipStatementModeRequired -> aformSection MsgExamAuthorshipStatementSection - *> (fmap Just $ contentField (setTooltip MsgExamAuthorshipStatementRequiredDisabledOnTip)) + SchoolAuthorshipStatementModeNone -> pure Nothing -- suppress display of whole section incl. header + otherMode -> aformSection MsgExamAuthorshipStatementSection + *> case otherMode of + SchoolAuthorshipStatementModeOptional -> optionalActionA + (contentField id) + (fslI MsgExamAuthorshipStatementRequired & setTooltip MsgExamAuthorshipStatementRequiredTip) + ((is _Just . efAuthorshipStatement <$> template) <|> (pure $ is _Just schoolSheetExamAuthorshipStatementDefinition)) + SchoolAuthorshipStatementModeRequired -> fmap Just . contentField $ setTooltip MsgExamAuthorshipStatementRequiredDisabledOnTip + _none -> pure Nothing officeSchoolsForm :: Maybe (Set SchoolId) -> AForm Handler (Set SchoolId) officeSchoolsForm mPrev = wFormToAForm $ do