feat(exams): basic required optional action for authorship statements

This commit is contained in:
Sarah Vaupel 2021-06-09 15:35:34 +02:00 committed by Gregor Kleen
parent a1111b498f
commit 5cc41aeef9
4 changed files with 45 additions and 4 deletions

View File

@ -314,7 +314,10 @@ ExamGradingMixed: Gemischt
ExamFinished: Ergebnisse sichtbar ab
ExamAuthorshipStatementSection: Eigenständigkeitserklärung
ExamAuthorshipStatementRequired: Eigenständigkeitserklärung für zugehörige Übungsblattabgaben einfordern?
ExamAuthorshipStatementRequired: Eigenständigkeitserklärung für prüfungszugehörige Übungsblattabgaben einfordern?
ExamAuthorshipStatementRequiredTip: Sollen für alle zu dieser Prüfung zugehörige Übungsblätter die Abgebenden (bei Abgabegruppen jedes Gruppenmitglied) aufgefordert werden, eine Eigenständigkeitserklärung zu akzeptieren?
ExamAuthorshipStatementUseSchoolDefinition: Eigenständigkeitserklärung des Instituts verwenden
ExamAuthorshipStatementRequiredDisabledOffTip: Für dieses Institut sind Eigenständigkeitserklärungen für prüfungsrelevante Blätter deaktiviert.
ExamAuthorshipStatementRequiredDisabledOnTip: Für dieses Institut sind Eigenständigkeitserklärungen für prüfungsrelevante Blätter vorgeschrieben.
ExamAuthorshipStatementUseSchoolDefinition: Eigenständigkeitserklärung des Instituts verwenden?
ExamAuthorshipStatementUseSchoolDefinitionTip: Soll die institutsweit eingestellte Eigenständigkeitserklärung genutzt werden? (Hinweis: Um konsistente Erklärungen für alle Abgaben einer Prüfung zu gewährleisten, dient die institutsweite Erklärung hier nur als Vorlage und wird ab dann getrennt (als Kopie) gespeichert. Ändert sich die institutsweite Erklärung, so muss die Änderung für diese Prüfung manuell übernommen werden, falls erwünscht.)
ExamAuthorshipStatementCustom: Benutzerdefinierte Eigenständigkeitserklärung

View File

@ -314,5 +314,8 @@ ExamFinished: Results visible from
ExamAuthorshipStatementSection: Statement of Authorship
ExamAuthorshipStatementRequired: Require Statement of Authorship for exam-related exercise sheet submissions?
ExamAuthorshipStatementRequiredTip: Should submittors (in case of submission groups each group member) be required to accept a Statement of Authorship for all exercise sheets related to this exam?
ExamAuthorshipStatementUseSchoolDefinition: Use school-wide Statement of Authorship
ExamAuthorshipStatementRequiredDisabledOffTip: This school permits Statements of Authorship for exam-related sheets.
ExamAuthorshipStatementRequiredDisabledOnTip: This school requires Statements of Authorship for exam-related sheets.
ExamAuthorshipStatementUseSchoolDefinition: Use school-wide Statement of Authorship?
ExamAuthorshipStatementUseSchoolDefinitionTip: Should the school-wide Statement of Authorship be used? (Hint: To ensure consistent statements for all submissions related to this exam, the school-wide statement will be used as a template here and will then be stored separately (as a copy). If the school-wide statement changes, this change must be applied manually for this exam if desired.)
ExamAuthorshipStatementCustom: Custom Statement of Authorship

View File

@ -20,7 +20,7 @@ Exam
examMode ExamMode
staff Text Maybe
partsFrom UTCTime Maybe
-- authorshipStatement AuthorshipStatementDefinitionId Maybe
-- authorshipStatement AuthorshipStatementDefinitionId Maybe
UniqueExam course name
deriving Generic
ExamPart

View File

@ -143,6 +143,41 @@ examForm (Entity _ Course{..}) template csrf = hoist liftHandler $ do
<*> examCorrectorsForm (efCorrectors <$> template)
<* aformSection MsgExamFormParts
<*> examPartsForm (efExamParts <$> template)
-- TODO: refactor messages to be used across scopes, then define this form section separately (to be used for exams and sheets)
<* aformSection MsgExamAuthorshipStatementSection
<* optionalActionA
( optionalActionA
( apreq htmlField
(fslI MsgExamAuthorshipStatementCustom)
(
-- TODO: load custom statement from template
-- (loading school definition as default is not necessary if it is displayed in form)
Nothing
)
)
( fslI MsgExamAuthorshipStatementUseSchoolDefinition
& setTooltip MsgExamAuthorshipStatementUseSchoolDefinitionTip
-- TODO: disable field if school settings prevent custom statements
-- & addAttr "disabled" "disabled" & setTooltip MsgExamAuthorshipStatementUseSchoolDefinitionDisabledTip
)
(
-- TODO: set value to False if school settings prevent custom statements
Nothing
)
-- apreq htmlField
-- (fslI MsgExamAuthorshipStatementCustom)
-- (Nothing)
)
( case schoolSheetExamAuthorshipStatementMode of
SchoolAuthorshipStatementModeNone -> fslI MsgExamAuthorshipStatementRequired & addAttr "disabled" "disabled" & setTooltip MsgExamAuthorshipStatementRequiredDisabledOffTip
SchoolAuthorshipStatementModeOptional -> fslI MsgExamAuthorshipStatementRequired & setTooltip MsgExamAuthorshipStatementRequiredTip
SchoolAuthorshipStatementModeRequired -> fslI MsgExamAuthorshipStatementRequired & addAttr "disabled" "disabled" & setTooltip MsgExamAuthorshipStatementRequiredDisabledOnTip
)
( case schoolSheetExamAuthorshipStatementMode of
SchoolAuthorshipStatementModeNone -> Just False
SchoolAuthorshipStatementModeOptional -> Nothing -- TODO: set value according to template
SchoolAuthorshipStatementModeRequired -> Just True
)
officeSchoolsForm :: Maybe (Set SchoolId) -> AForm Handler (Set SchoolId)
officeSchoolsForm mPrev = wFormToAForm $ do