refactor(exams): add FIXME markers (exam form still broken)
This commit is contained in:
parent
fe78377fae
commit
1e87aa2dfe
@ -169,7 +169,7 @@ examForm (Entity _ Course{..}) template csrf = hoist liftHandler $ do
|
|||||||
( case schoolSheetExamAuthorshipStatementMode of
|
( case schoolSheetExamAuthorshipStatementMode of
|
||||||
SchoolAuthorshipStatementModeNone -> Just False
|
SchoolAuthorshipStatementModeNone -> Just False
|
||||||
SchoolAuthorshipStatementModeOptional -> (is _Just . efAuthorshipStatement <$> template) <|> (pure $ is _Just schoolSheetExamAuthorshipStatementDefinition)
|
SchoolAuthorshipStatementModeOptional -> (is _Just . efAuthorshipStatement <$> template) <|> (pure $ is _Just schoolSheetExamAuthorshipStatementDefinition)
|
||||||
SchoolAuthorshipStatementModeRequired -> Just True
|
SchoolAuthorshipStatementModeRequired -> Just True -- FIXME: checkbox is unticked after form submit with school defaults (e.g. required, school definition given and unchanged)
|
||||||
)
|
)
|
||||||
|
|
||||||
officeSchoolsForm :: Maybe (Set SchoolId) -> AForm Handler (Set SchoolId)
|
officeSchoolsForm :: Maybe (Set SchoolId) -> AForm Handler (Set SchoolId)
|
||||||
@ -564,7 +564,7 @@ validateExam cId oldExam = do
|
|||||||
_otherwise -> return ()
|
_otherwise -> return ()
|
||||||
whenIsJust efAuthorshipStatement $ \statementContent -> do
|
whenIsJust efAuthorshipStatement $ \statementContent -> do
|
||||||
mSchoolAuthorshipStatement <- lift $ maybe (pure Nothing) getEntity schoolSheetExamAuthorshipStatementDefinition
|
mSchoolAuthorshipStatement <- lift $ maybe (pure Nothing) getEntity schoolSheetExamAuthorshipStatementDefinition
|
||||||
guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ schoolSheetExamAuthorshipStatementMode /= SchoolAuthorshipStatementModeRequired || statementContent /= mempty
|
guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ schoolSheetExamAuthorshipStatementMode /= SchoolAuthorshipStatementModeRequired || statementContent /= mempty -- FIXME: form validation fails in required mode with non-empty school default
|
||||||
guardValidation MsgExamAuthorshipStatementMustMatchSchoolDefinition $ not schoolSheetExamAuthorshipStatementAllowOther && Just statementContent == (authorshipStatementDefinitionContent . entityVal <$> mSchoolAuthorshipStatement)
|
guardValidation MsgExamAuthorshipStatementMustMatchSchoolDefinition $ not schoolSheetExamAuthorshipStatementAllowOther && Just statementContent == (authorshipStatementDefinitionContent . entityVal <$> mSchoolAuthorshipStatement)
|
||||||
|
|
||||||
unless (has (_Just . _entityVal . _examStaff . _Nothing) oldExam) $
|
unless (has (_Just . _entityVal . _examStaff . _Nothing) oldExam) $
|
||||||
|
|||||||
Reference in New Issue
Block a user