$newline never $maybe Entity _ ExamResult{examResultResult} <- result $if gradingShown

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

$case examResultResult $of ExamAttended grade $if examShowGrades _{grade} $else $if passingGrade grade _{MsgExamPassed} $else _{MsgExamNotPassed} $of ExamNoShow _{MsgExamNoShow} $of ExamVoided _{MsgExamVoided} $maybe desc <- examDescription

#{desc}
$if not examVisible
_{MsgExamVisibleFrom}
$maybe from <- examVisibleFrom ^{formatTimeW SelFormatDateTime from} $nothing _{MsgNever} \ ^{isVisible False} $maybe regFrom <- examRegisterFrom
_{MsgExamRegisterFrom}
^{formatTimeW SelFormatDateTime regFrom} $maybe regTo <- examRegisterTo
_{MsgExamRegisterTo}
^{formatTimeW SelFormatDateTime regTo} $maybe deregUntil <- examDeregisterUntil
_{MsgExamDeregisterUntil}
^{formatTimeW SelFormatDateTime deregUntil}
_{MsgExamPublishOccurrenceAssignmentsParticipant}
^{formatTimeW SelFormatDateTime examPublishOccurrenceAssignments} $if examTimes
_{MsgExamTime}
^{formatTimeW SelFormatDateTime examStart} $maybe end <- examEnd \ – ^{formatTimeW (bool SelFormatDateTime SelFormatTime ((on (==) utctDay) examStart end)) end} $maybe finished <- examFinished
_{MsgExamFinishedParticipant}
^{formatTimeW SelFormatDateTime finished} $if gradingShown $if examGradingRule /= ExamGradingManual
_{MsgExamGradingRule} $if not gradingVisible \ ^{isVisible False}
$case examGradingRule $of ExamGradingManual _{MsgExamGradingManual'} $of ExamGradingKey{..} ^{gradingKeyW examGradingKey} $if examBonusRule /= ExamNoBonus
_{MsgExamBonusRule} $if not gradingVisible \ ^{isVisible False}
^{examBonusW examBonusRule} $if occurrenceAssignmentsShown
_{MsgExamOccurrenceRuleParticipant} $if not occurrenceAssignmentsVisible \ ^{isVisible False}
$# TODO $maybe registerWdgt <- registerWidget
_{MsgExamRegistration}
^{registerWdgt} $if not (null occurrences)

_{MsgExamOccurrences} $forall (Entity _occId ExamOccurrence{examOccurrenceRoom, examOccurrenceStart, examOccurrenceEnd, examOccurrenceDescription}, registered) <- occurrences
_{MsgExamRoom} $if not examTimes _{MsgExamRoomTime} _{MsgExamRoomDescription} $if occurrenceAssignmentsShown _{MsgExamRoomRegistered} $if not occurrenceAssignmentsVisible \ ^{isVisible False}
#{examOccurrenceRoom} $if not examTimes ^{formatTimeW SelFormatDateTime examOccurrenceStart} $maybe end <- examOccurrenceEnd \ – ^{formatTimeW (bool SelFormatDateTime SelFormatTime ((on (==) utctDay) examStart end)) end} $maybe desc <- examOccurrenceDescription #{desc} $if occurrenceAssignmentsShown $if registered #{fontAwesomeIcon "check"} $if gradingShown && not (null parts)

_{MsgExamParts} $if gradingShown && not gradingVisible \ ^{isVisible False} $forall Entity partId ExamPart{examPartName, examPartWeight, examPartMaxPoints} <- parts
_{MsgExamPartName} _{MsgExamPartMaxPoints} _{MsgExamPartResultPoints}
#{examPartName} $maybe mPoints <- examPartMaxPoints #{showFixed True (fromRational examPartWeight * mPoints)} $case fmap (examPartResultResult . entityVal) (results !? partId) $of Nothing $of Just (ExamAttended (Just ps)) #{showFixed True ps} $of Just (ExamAttended Nothing) #{fontAwesomeIcon "check"} $of Just ExamNoShow _{MsgExamNoShow} $of Just ExamVoided _{MsgExamVoided} $# TODO: Statistics