fix(exams): correctly treat school-mode optional as off by default

This commit is contained in:
Sarah Vaupel 2021-06-19 10:17:42 +02:00 committed by Gregor Kleen
parent 5c813ed02b
commit ac86832b34

View File

@ -163,10 +163,9 @@ examForm (Entity _ Course{..}) template csrf = hoist liftHandler $ do
SchoolAuthorshipStatementModeNone -> pure Nothing -- suppress display of whole section incl. header
otherMode -> aformSection MsgExamAuthorshipStatementSection
*> case otherMode of
SchoolAuthorshipStatementModeOptional -> optionalActionA
(contentField id)
SchoolAuthorshipStatementModeOptional -> optionalActionA (contentField id)
(fslI MsgExamAuthorshipStatementRequired & setTooltip MsgExamAuthorshipStatementRequiredTip)
((is _Just . efAuthorshipStatement <$> template) <|> (pure $ is _Just schoolSheetExamAuthorshipStatementDefinition))
(is _Just . efAuthorshipStatement <$> template)
SchoolAuthorshipStatementModeRequired -> fmap Just . contentField $ setTooltip MsgExamAuthorshipStatementRequiredDisabledOnTip
_none -> pure Nothing