fix(sheets): fixhance sheet authship form section

This commit is contained in:
Sarah Vaupel 2021-06-19 12:31:14 +02:00 committed by Gregor Kleen
parent 491f7d3582
commit 7192cb527c
3 changed files with 25 additions and 26 deletions

View File

@ -157,4 +157,5 @@ SheetAuthorshipStatementRequired: Eigenständigkeitserklärung für Übungsblatt
SheetAuthorshipStatementRequiredTip: Sollen die Abgebenden (bei Abgabegruppen jedes Gruppenmitglied) aufgefordert werden, eine Eigenständigkeitserklärung zu akzeptieren? SheetAuthorshipStatementRequiredTip: Sollen die Abgebenden (bei Abgabegruppen jedes Gruppenmitglied) aufgefordert werden, eine Eigenständigkeitserklärung zu akzeptieren?
SheetAuthorshipStatementRequiredForcedTip: Für dieses Institut sind Eigenständigkeitserklärungen für nicht-prüfungszugehörige Übungsblätter vorgeschrieben. SheetAuthorshipStatementRequiredForcedTip: Für dieses Institut sind Eigenständigkeitserklärungen für nicht-prüfungszugehörige Übungsblätter vorgeschrieben.
SheetAuthorshipStatementContent: Eigenständigkeitserklärung SheetAuthorshipStatementContent: Eigenständigkeitserklärung
SheetAuthorshipStatementContentForcedTip: Für dieses Institut ist die institutsweit vorgegebene Eigenständigkeitserklärung für nicht-prüfungszugehörige Übungsblätter zu verwenden. Benutzerdefinierte Erklärungen sind nicht gestattet.
SheetAuthorshipStatementContentOverridesExamTip: Gehört dieses Übungsblatt zu einer Prüfung mit einer prüfungsweit eingestellten Eigenständigkeitserklärung, so können Sie hier eine für dieses Übungsblatt abweichende Eigenständigkeitserklärung angeben. SheetAuthorshipStatementContentOverridesExamTip: Gehört dieses Übungsblatt zu einer Prüfung mit einer prüfungsweit eingestellten Eigenständigkeitserklärung, so können Sie hier eine für dieses Übungsblatt abweichende Eigenständigkeitserklärung angeben.

View File

@ -156,4 +156,5 @@ SheetAuthorshipStatementRequired: Require Statement of Authorship for submission
SheetAuthorshipStatementRequiredTip: Should submittors (each group member in case of submission groups) be required to accept a Statement of Authorship? SheetAuthorshipStatementRequiredTip: Should submittors (each group member in case of submission groups) be required to accept a Statement of Authorship?
SheetAuthorshipStatementRequiredForcedTip: This school enforces Statements of Authorship for all exam-unrelated exercise sheets. SheetAuthorshipStatementRequiredForcedTip: This school enforces Statements of Authorship for all exam-unrelated exercise sheets.
SheetAuthorshipStatementContent: Statement of Authorship SheetAuthorshipStatementContent: Statement of Authorship
SheetAuthorshipStatementContentForcedTip: The settings of this school dictate that the school-wide Statement of Authorship for exam-unrelated sheets must be used. Custom statements are prohibited.
SheetAuthorshipStatementContentOverridesExamTip: If this exercise sheet is related to an exam with an exam-wide Statement of Authorship set, a sheet-specific adaptation can be given here. SheetAuthorshipStatementContentOverridesExamTip: If this exercise sheet is related to an exam with an exam-wide Statement of Authorship set, a sheet-specific adaptation can be given here.

View File

@ -66,7 +66,7 @@ makeSheetForm cId msId template = identifyForm FIDsheet . validateForm validateS
(Just sId) -> liftHandler $ runDB $ getFtIdMap sId (Just sId) -> liftHandler $ runDB $ getFtIdMap sId
MsgRenderer mr <- getMsgRenderer MsgRenderer mr <- getMsgRenderer
ctime <- ceilingQuarterHour <$> liftIO getCurrentTime ctime <- ceilingQuarterHour <$> liftIO getCurrentTime
((_school, _mSchoolAuthorshipStatement), _course) <- liftHandler . runDB $ do ((School{..}, mSchoolAuthorshipStatement), _course) <- liftHandler . runDB $ do
course@Course{courseSchool} <- get404 cId course@Course{courseSchool} <- get404 cId
school@School{..} <- get404 courseSchool school@School{..} <- get404 courseSchool
mSchoolAuthorshipStatement <- runMaybeT $ do mSchoolAuthorshipStatement <- runMaybeT $ do
@ -105,31 +105,28 @@ makeSheetForm cId msId template = identifyForm FIDsheet . validateForm validateS
<*> aopt htmlField (fslI MsgSheetMarking) (sfMarkingText <$> template) <*> aopt htmlField (fslI MsgSheetMarking) (sfMarkingText <$> template)
<*> apopt checkBoxField (fslI MsgSheetAnonymousCorrection & setTooltip MsgSheetAnonymousCorrectionTip) (sfAnonymousCorrection <$> template) <*> apopt checkBoxField (fslI MsgSheetAnonymousCorrection & setTooltip MsgSheetAnonymousCorrectionTip) (sfAnonymousCorrection <$> template)
<*> correctorForm (maybe mempty sfCorrectors template) <*> correctorForm (maybe mempty sfCorrectors template)
<* aformSection MsgSheetAuthorshipStatementSection -- TODO: add info: define exam-unrelated/related, if exam-unrelated: applies to sheet, if exam-related: overrides exam-wide authship statement settings
-- TODO: add info: applies to exam-unrelated sheets and overrides exam definition if sheet is related to an exam and this exam has an authorship statement -- TODO: compare versions of current school statement and template statement: school > template if school statement is newer than template statement, template > school otherwise (TODO: add lastEdited to models?)
-- TODO: compare versions: school > msId if school statement is newer than msId statement, msId > school otherwise (TODO: add lastEdited to model) <*> let
<*> pure Nothing -- TODO reqContentField :: (FieldSettings UniWorX -> FieldSettings UniWorX) -> AForm Handler StoredMarkup
-- <*> optionalActionA reqContentField ttip = areq htmlField
-- ( areq htmlField (fslI MsgSheetAuthorshipStatementContent & ttip)
-- (fslI MsgSheetAuthorshipStatementContent) ( (join $ sfAuthorshipStatement <$> template)
-- ( <|> (authorshipStatementDefinitionContent . entityVal <$> mSchoolAuthorshipStatement)
-- -- TODO: select correct school settings wrt. exam-related/exam-unrelated )
-- -- TODO: if school enforces school-wide statement, take school-wide statement forcedContentField = aforced htmlField
-- -- TODO: otherwise, take value from template, or take exam-wide statement if there is any, or take the school default if there is any (fslI MsgSheetAuthorshipStatementContent & setTooltip MsgSheetAuthorshipStatementContentForcedTip)
-- (fromMaybe mempty $ sfAuthorshipStatement <$> template <|> (Just . authorshipStatementDefinitionContent . entityVal) <$> mSchoolAuthorshipStatement) (maybe mempty (authorshipStatementDefinitionContent . entityVal) mSchoolAuthorshipStatement)
-- ) contentField ttipReq = bool forcedContentField (reqContentField ttipReq) schoolSheetAuthorshipStatementAllowOther
-- ) in case schoolSheetAuthorshipStatementMode of
-- ( fslI MsgSheetAuthorshipStatementRequired SchoolAuthorshipStatementModeNone -> pure Nothing -- suppress display of whole section incl. header
-- & setTooltip MsgSheetAuthorshipStatementRequiredTip otherMode -> aformSection MsgSheetAuthorshipStatementSection
-- -- TODO: set disabled attr if school mode disables or enforces statements *> case otherMode of
-- -- TODO: select school mode wrt. exam-related/exam-unrelated: Is this sheet related to an exam? If yes, take school exam sheet mode, otherwise take school sheet mode SchoolAuthorshipStatementModeOptional -> optionalActionA (contentField id)
-- ) (fslI MsgSheetAuthorshipStatementRequired & setTooltip MsgSheetAuthorshipStatementRequiredTip)
-- ( (is _Just . sfAuthorshipStatement <$> template)
-- -- TODO: if school disables/enforces statements for this sheet (exam-related/exam-unrelated?), set value accordingly SchoolAuthorshipStatementModeRequired -> fmap Just . contentField $ setTooltip MsgSheetAuthorshipStatementRequiredForcedTip
-- -- TODO: if this sheet is related to an exam and this exam enforces statements, set value accordingly _none -> pure Nothing
-- -- TODO: otherwise, take value from template, or `Just True` if the school has a non-empty school-wide default
-- (is _Just . sfAuthorshipStatement <$> template)
-- )
where where
makeSheetPersonalisedFilesForm :: Maybe SheetPersonalisedFilesForm -> MForm Handler (AForm Handler SheetPersonalisedFilesForm) makeSheetPersonalisedFilesForm :: Maybe SheetPersonalisedFilesForm -> MForm Handler (AForm Handler SheetPersonalisedFilesForm)
makeSheetPersonalisedFilesForm template' = do makeSheetPersonalisedFilesForm template' = do