$newline never $# SPDX-FileCopyrightText: 2022 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Wolfgang Witt $# $# SPDX-License-Identifier: AGPL-3.0-or-later $maybe Entity _ ExamResult{examResultResult} <- result $if gradingShown

_{MsgTableExamResult} $if gradingShown && not gradingVisible \ ^{isVisible False}

$case examResultResult $of ExamAttended grade _{grade} $of ExamNoShow _{MsgExamNoShow} $of ExamVoided _{MsgExamVoided} $maybe desc <- examDescription

#{desc}
$maybe warn <- notificationDiscouragedExamMode ^{warn}
$if not examVisible
_{MsgExamVisibleFrom}
$maybe from <- examVisibleFrom ^{formatTimeW SelFormatDateTime from} $nothing _{MsgExamNever} \ ^{isVisible False} $maybe regFrom <- examRegisterFrom
_{MsgTableExamRegisterFrom}
^{formatTimeW SelFormatDateTime regFrom} $maybe regTo <- examRegisterTo
_{MsgTableExamRegisterTo}
^{formatTimeW SelFormatDateTime regTo} $maybe deregUntil <- examDeregisterUntil
_{MsgExamDeregisterUntil}
^{formatTimeW SelFormatDateTime deregUntil} $maybe publishAssignments <- examPublishOccurrenceAssignments
_{MsgExamPublishOccurrenceAssignmentsParticipant}
^{formatTimeW SelFormatDateTime publishAssignments} $maybe online <- examOnline examExamMode
_{MsgExamShowOnline}
$case online $of ExamOnlinePreset p ^{examOnlinePresetWidget p} $of ExamOnlineCustom c #{c} $maybe synchronicity <- examSynchronicity examExamMode
_{MsgExamShowSynchronicity}
$case synchronicity $of ExamSynchronicityPreset p ^{examSynchronicityPresetWidget p} $of ExamSynchronicityCustom c #{c} $maybe aids <- examAids examExamMode
_{MsgExamShowAids}
$case aids $of ExamAidsPreset p ^{examAidsPresetWidget p} $of ExamAidsCustom c #{c} $maybe requiredEquipment <- examRequiredEquipment examExamMode
_{MsgExamShowRequiredEquipment}

$case requiredEquipment $of ExamRequiredEquipmentPreset p ^{examRequiredEquipmentPresetWidget p} $of ExamRequiredEquipmentCustom c #{c} ^{notificationPersonalIdentification} $maybe room <- examRoom

_{MsgExamRoom}
^{roomReferenceWidget room} $if examTimes
_{MsgTableExamTime}
$maybe start <- examStart ^{formatTimeRangeW SelFormatDateTime start examEnd} $maybe finished <- examFinished
_{examFinishedMsg}
^{formatTimeW SelFormatDateTime finished} $if examClosedShown $maybe closed <- examClosed
_{MsgExamClosed} ^{isVisible False}
^{formatTimeW SelFormatDateTime closed} $maybe staff <- examStaff $if staffInfoShown
_{MsgExamStaff} ^{isVisible False}
#{staff} $if staffInfoShown && not (onull extraSchools)
_{MsgExamExamOfficeSchools} ^{isVisible False}
    $forall Entity _ School{schoolName} <- extraSchools
  • #{schoolName} $if gradingShown $maybe gradingRule <- examGradingRule
    _{MsgExamGradingRule} $if not gradingVisible \ ^{isVisible False}
    $case gradingRule $of ExamGradingKey{..} ^{gradingKeyW examGradingKey} $maybe bonusRule <- examBonusRule
    _{MsgExamBonusRule} $if not gradingVisible \ ^{isVisible False}
    ^{examBonusW bonusRule} $if examOccurrenceRule /= ExamRoomManual $if occurrenceAssignmentsShown
    _{MsgExamOccurrenceRuleParticipant} $if not occurrenceAssignmentsVisible \ ^{isVisible False}
    _{classifyExamOccurrenceRule examOccurrenceRule} $if showRegisteredCount
    _{MsgExamRegisteredCount}
    #{registeredCount} $maybe registerWdgt <- registerWidget Nothing
    _{MsgTableExamRegistration}
    ^{registerWdgt} $if is _Nothing (examRequiredEquipment examExamMode) ^{notificationPersonalIdentification} $if (showCloseWidget && is _Nothing examClosed) && (showFinishWidget && is _Nothing examFinished)

    _{MsgExamCloseHeading} \ ^{isVisible False} ^{closeWgt}

    _{MsgExamFinishHeading} \ ^{isVisible False} ^{finishWgt} $else $if showCloseWidget && is _Nothing examClosed

    _{MsgExamCloseHeading} \ ^{isVisible False} ^{closeWgt} $if showFinishWidget && is _Nothing examFinished

    _{MsgExamFinishHeading} \ ^{isVisible False} ^{finishWgt} $if examOccurrenceRuleAutomatic examOccurrenceRule && showAutoOccurrenceCalculateWidget

    _{MsgExamAutoOccurrenceHeading} \ ^{isVisible False} ^{examAutoOccurrenceCalculateWidget tid ssh csh examn} $if not (null occurrences)

    $if examTimes _{MsgExamRooms} $elseif is _Just examRoom _{MsgExamTimes} $else _{MsgExamOccurrences} $if occurrenceNamesShown $forall (occurrence, registered, rCount, showRoom) <- occurrences $with Entity _occId ExamOccurrence{examOccurrenceName, examOccurrenceRoom, examOccurrenceStart, examOccurrenceEnd, examOccurrenceDescription} <- occurrence $with registerWdgt <- registerWidget (Just occurrence) $if occurrenceNamesShown $if occurrenceNamesShown
    _{MsgExamRoomName} \ ^{isVisible False} $if is _Nothing examRoom _{MsgExamRoom} $if not examTimes _{MsgExamRoomTime} $if showOccurrenceRegisterColumn $if examOccurrenceRule == ExamRoomFifo _{MsgExamRoomRegistered} $else _{MsgExamRoomAssigned} $if not occurrenceAssignmentsVisible \ ^{isVisible False} $if showOccurrenceMappingColumn $case fmap examOccurrenceMappingRule examExamOccurrenceMapping $of Just ExamRoomSurname _{MsgExamRoomMappingSurname} $if not occurrenceAssignmentsVisible \ ^{isVisible False} $of Just ExamRoomMatriculation _{MsgExamRoomMappingMatriculation} $if not occurrenceAssignmentsVisible \ ^{isVisible False} $of Just ExamRoomRandom _{MsgExamRoomMappingRandom} $if not occurrenceAssignmentsVisible \ ^{isVisible False} $of _ $if not occurrenceAssignmentsVisible ^{isVisible False} $if showRegisteredCount _{MsgExamRegisteredCount} \ ^{isVisible False} _{MsgExamRoomDescription}
    #{examOccurrenceName} $if is _Nothing examRoom $if showRoom $maybe room <- examOccurrenceRoom ^{roomReferenceWidget room} $nothing _{MsgExamOccurrenceRoomIsUnset} $else _{MsgExamOccurrenceRoomIsHidden} $if not examTimes ^{formatTimeRangeW SelFormatDateTime examOccurrenceStart examOccurrenceEnd} $if showOccurrenceRegisterColumn $maybe registerWdgt' <- registerWdgt ^{registerWdgt'} $nothing $if registered #{iconOK} $if showOccurrenceMappingColumn $maybe mappingWgt <- occurrenceMapping examOccurrenceName ^{mappingWgt} $if showRegisteredCount #{rCount} $maybe desc <- examOccurrenceDescription #{desc}
    $if is _Nothing examRoom $if not examTimes $if showOccurrenceRegisterColumn $if showOccurrenceMappingColumn $if showRegisteredCount $if sumRegisteredCount == registeredCount #{sumRegisteredCount} $else _{MsgExamRegisteredCountOf sumRegisteredCount registeredCount} $if (gradingShown || partsShown) && not (null examParts)

    _{MsgExamParts} $if (gradingShown && not gradingVisible) || (partsShown && not partsVisible) \ ^{isVisible False} $if partNumbersShown $forall (Entity partId ExamPart{examPartNumber, examPartName, examPartWeight, examPartMaxPoints}, cID, partSheets) <- examParts $if partNumbersShown $maybe mPoints <- fmap (examBonusBonus . entityVal) bonus $if showMaxPoints $if partNumbersShown $if partNumbersShown $if partNumbersShown $if partNumbersShown
    _{MsgExamPartNumber} ^{isVisible False} _{MsgExamPartName} $if showPartSheets _{MsgExamPartSheets} $if showMaxPoints _{MsgExamPartMaxPoints} $if showAchievedPoints _{MsgExamPartResultPoints}
    #{examPartNumber} $maybe pName <- examPartName #{pName} $nothing _{MsgExamPartNumbered examPartNumber} $if showPartSheets $if not (null partSheets) $maybe mPoints <- examPartMaxPoints #{showFixed True (fromRational examPartWeight * mPoints)} $if showAchievedPoints $case fmap (examPartResultResult . entityVal) (results !? partId) $of Nothing $of Just (ExamAttended ps) #{showFixed True ps} $of Just ExamNoShow _{MsgExamNoShow} $of Just ExamVoided _{MsgExamVoided}
    $if showPartSheets #{showFixed True sumMaxPoints}
    _{MsgExamBonusAchieved} $if showPartSheets $if showMaxPoints $if showAchievedPoints #{showFixed True mPoints}
    $if showPartSheets $if showMaxPoints $if showAchievedPoints $case sumPoints $of ExamAttended ps #{showFixed True ps} $of _ $nothing
    $if showPartSheets $if showMaxPoints #{showFixed True sumMaxPoints} $if showAchievedPoints $case sumPoints $of ExamAttended ps #{showFixed True ps} $of _ $# TODO: Statistics