From 1e87aa2dfe7119c7b7075782128cee020e9261e4 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 11 Jun 2021 13:08:14 +0200 Subject: [PATCH] refactor(exams): add FIXME markers (exam form still broken) --- src/Handler/Exam/Form.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index 9deb02102..7ea49ca6c 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -169,7 +169,7 @@ examForm (Entity _ Course{..}) template csrf = hoist liftHandler $ do ( case schoolSheetExamAuthorshipStatementMode of SchoolAuthorshipStatementModeNone -> Just False 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) @@ -564,7 +564,7 @@ validateExam cId oldExam = do _otherwise -> return () whenIsJust efAuthorshipStatement $ \statementContent -> do 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) unless (has (_Just . _entityVal . _examStaff . _Nothing) oldExam) $