fix(exams): remove deprecated/unnecessary form validation wrt. authship statements
This commit is contained in:
parent
ac86832b34
commit
bf059a1320
@ -555,14 +555,5 @@ validateExam cId oldExam = do
|
||||
|
||||
warnValidation MsgExamModeSchoolDiscouraged . not $ evalExamModeDNF schoolExamDiscouragedModes efExamMode
|
||||
|
||||
case schoolSheetExamAuthorshipStatementMode of
|
||||
SchoolAuthorshipStatementModeNone -> guardValidation MsgExamAuthorshipStatementMustBeEmpty $ is _Nothing efAuthorshipStatement
|
||||
SchoolAuthorshipStatementModeRequired -> guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ is _Just efAuthorshipStatement
|
||||
_otherwise -> return ()
|
||||
whenIsJust efAuthorshipStatement $ \statementContent -> do
|
||||
mSchoolAuthorshipStatement <- lift $ maybe (pure Nothing) getEntity schoolSheetExamAuthorshipStatementDefinition
|
||||
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) $
|
||||
guardValidation MsgExamStaffRequired $ isn't _Nothing efStaff
|
||||
|
||||
Loading…
Reference in New Issue
Block a user