This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/templates/exam-show.hamlet
2022-10-12 09:35:16 +02:00

402 lines
14 KiB
Plaintext

$newline never
$# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>,Wolfgang Witt <Wolfgang.Witt@campus.lmu.de>
$#
$# SPDX-License-Identifier: AGPL-3.0-or-later
$maybe Entity _ ExamResult{examResultResult} <- result
$if gradingShown
<section>
<h2>
_{MsgTableExamResult}
$if gradingShown && not gradingVisible
\ ^{isVisible False}
<p .result>
$case examResultResult
$of ExamAttended grade
_{grade}
$of ExamNoShow
_{MsgExamNoShow}
$of ExamVoided
_{MsgExamVoided}
$maybe desc <- examDescription
<section>
#{desc}
<section>
$maybe warn <- notificationDiscouragedExamMode
^{warn}
<dl .deflist>
$if not examVisible
<dt .deflist__dt>_{MsgExamVisibleFrom}
<dd .deflist__dd>
$maybe from <- examVisibleFrom
^{formatTimeW SelFormatDateTime from}
$nothing
_{MsgExamNever}
\ ^{isVisible False}
$maybe regFrom <- examRegisterFrom
<dt .deflist__dt>_{MsgTableExamRegisterFrom}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime regFrom}
$maybe regTo <- examRegisterTo
<dt .deflist__dt>_{MsgTableExamRegisterTo}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime regTo}
$maybe deregUntil <- examDeregisterUntil
<dt .deflist__dt>_{MsgExamDeregisterUntil}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime deregUntil}
$maybe publishAssignments <- examPublishOccurrenceAssignments
<dt .deflist__dt>_{MsgExamPublishOccurrenceAssignmentsParticipant}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime publishAssignments}
$maybe online <- examOnline examExamMode
<dt .deflist__dt>_{MsgExamShowOnline}
<dd .deflist__dd>
$case online
$of ExamOnlinePreset p
^{examOnlinePresetWidget p}
$of ExamOnlineCustom c
#{c}
$maybe synchronicity <- examSynchronicity examExamMode
<dt .deflist__dt>_{MsgExamShowSynchronicity}
<dd .deflist__dd>
$case synchronicity
$of ExamSynchronicityPreset p
^{examSynchronicityPresetWidget p}
$of ExamSynchronicityCustom c
#{c}
$maybe aids <- examAids examExamMode
<dt .deflist__dt>_{MsgExamShowAids}
<dd .deflist__dd>
$case aids
$of ExamAidsPreset p
^{examAidsPresetWidget p}
$of ExamAidsCustom c
#{c}
$maybe requiredEquipment <- examRequiredEquipment examExamMode
<dt .deflist__dt>_{MsgExamShowRequiredEquipment}
<dd .deflist__dd>
<p>
$case requiredEquipment
$of ExamRequiredEquipmentPreset p
^{examRequiredEquipmentPresetWidget p}
$of ExamRequiredEquipmentCustom c
#{c}
^{notificationPersonalIdentification}
$maybe room <- examRoom
<dt .deflist__dt>_{MsgExamRoom}
<dd .deflist__dd>^{roomReferenceWidget room}
$if examTimes
<dt .deflist__dt>_{MsgTableExamTime}
<dd .deflist__dd>
$maybe start <- examStart
^{formatTimeRangeW SelFormatDateTime start examEnd}
$maybe finished <- examFinished
<dt .deflist__dt>_{examFinishedMsg}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime finished}
$if examClosedShown
$maybe closed <- examClosed
<dt .deflist__dt>_{MsgExamClosed} ^{isVisible False}
<dd .deflist__dd>^{formatTimeW SelFormatDateTime closed}
$maybe staff <- examStaff
$if staffInfoShown
<dd .deflist__dt>_{MsgExamStaff} ^{isVisible False}
<dt .deflist__dd>#{staff}
$if staffInfoShown && not (onull extraSchools)
<dd .deflist__dt>_{MsgExamExamOfficeSchools} ^{isVisible False}
<dt .deflist__dd>
<ul>
$forall Entity _ School{schoolName} <- extraSchools
<li>#{schoolName}
$if gradingShown
$maybe gradingRule <- examGradingRule
<dt .deflist__dt>
_{MsgExamGradingRule}
$if not gradingVisible
\ ^{isVisible False}
<dd .deflist__dd>
$case gradingRule
$of ExamGradingKey{..}
^{gradingKeyW examGradingKey}
$maybe bonusRule <- examBonusRule
<dt .deflist__dt>
_{MsgExamBonusRule}
$if not gradingVisible
\ ^{isVisible False}
<dd .deflist__dd>
^{examBonusW bonusRule}
$if examOccurrenceRule /= ExamRoomManual
$if occurrenceAssignmentsShown
<dt .deflist__dt>
_{MsgExamOccurrenceRuleParticipant}
$if not occurrenceAssignmentsVisible
\ ^{isVisible False}
<dd .deflist__dd>
_{classifyExamOccurrenceRule examOccurrenceRule}
$if showRegisteredCount
<dt .deflist__dt>_{MsgExamRegisteredCount}
<dd .deflist__dd>#{registeredCount}
$maybe registerWdgt <- registerWidget Nothing
<dt .deflist__dt>
_{MsgTableExamRegistration}
<dd .deflist__dd>
^{registerWdgt}
$if is _Nothing (examRequiredEquipment examExamMode)
^{notificationPersonalIdentification}
$if (showCloseWidget && is _Nothing examClosed) && (showFinishWidget && is _Nothing examFinished)
<div .two-column-sections>
<section>
<h2>
_{MsgExamCloseHeading}
\ ^{isVisible False}
^{closeWgt}
<section>
<h2>
_{MsgExamFinishHeading}
\ ^{isVisible False}
^{finishWgt}
$else
$if showCloseWidget && is _Nothing examClosed
<section>
<h2>
_{MsgExamCloseHeading}
\ ^{isVisible False}
^{closeWgt}
$if showFinishWidget && is _Nothing examFinished
<section>
<h2>
_{MsgExamFinishHeading}
\ ^{isVisible False}
^{finishWgt}
$if examOccurrenceRuleAutomatic examOccurrenceRule && showAutoOccurrenceCalculateWidget
<section>
<h2>
_{MsgExamAutoOccurrenceHeading}
\ ^{isVisible False}
^{examAutoOccurrenceCalculateWidget tid ssh csh examn}
$if not (null occurrences)
<section>
<h2>
$if examTimes
_{MsgExamRooms}
$elseif is _Just examRoom
_{MsgExamTimes}
$else
_{MsgExamOccurrences}
<table .table .table--striped .table--hover>
<thead>
<tr .table__row .table__row--head>
$if occurrenceNamesShown
<th .table__th>
_{MsgExamRoomName}
\ ^{isVisible False}
$if is _Nothing examRoom
<th .table__th>_{MsgExamRoom}
$if not examTimes
<th .table__th>_{MsgExamRoomTime}
$if showOccurrenceRegisterColumn
<th .table__th>
$if examOccurrenceRule == ExamRoomFifo
_{MsgExamRoomRegistered}
$else
_{MsgExamRoomAssigned}
$if not occurrenceAssignmentsVisible
\ ^{isVisible False}
$if showOccurrenceMappingColumn
$case fmap examOccurrenceMappingRule examExamOccurrenceMapping
$of Just ExamRoomSurname
<th .table__th>
_{MsgExamRoomMappingSurname}
$if not occurrenceAssignmentsVisible
\ ^{isVisible False}
$of Just ExamRoomMatriculation
<th .table__th>
_{MsgExamRoomMappingMatriculation}
$if not occurrenceAssignmentsVisible
\ ^{isVisible False}
$of Just ExamRoomRandom
<th .table__th>
_{MsgExamRoomMappingRandom}
$if not occurrenceAssignmentsVisible
\ ^{isVisible False}
$of _
<th .table__td>
$if not occurrenceAssignmentsVisible
^{isVisible False}
$if showRegisteredCount
<th .table__th>
_{MsgExamRegisteredCount}
\ ^{isVisible False}
<th .table__th>_{MsgExamRoomDescription}
<tbody>
$forall (occurrence, registered, rCount, showRoom) <- occurrences
$with Entity _occId ExamOccurrence{examOccurrenceName, examOccurrenceRoom, examOccurrenceStart, examOccurrenceEnd, examOccurrenceDescription} <- occurrence
$with registerWdgt <- registerWidget (Just occurrence)
<tr .table__row :markUnregisteredOccurrences (Just occurrence) && not registered:.occurrence--not-registered>
$if occurrenceNamesShown
<td .table__td #exam-occurrence__#{examOccurrenceName}>#{examOccurrenceName}
$if is _Nothing examRoom
$if showRoom
<td .table__td>
$maybe room <- examOccurrenceRoom
^{roomReferenceWidget room}
$nothing
_{MsgExamOccurrenceRoomIsUnset}
$else
<td .table__td .explanation>
_{MsgExamOccurrenceRoomIsHidden}
$if not examTimes
<td .table__td>
^{formatTimeRangeW SelFormatDateTime examOccurrenceStart examOccurrenceEnd}
$if showOccurrenceRegisterColumn
<td .table__td>
$maybe registerWdgt' <- registerWdgt
^{registerWdgt'}
$nothing
$if registered
#{iconOK}
$if showOccurrenceMappingColumn
<td .table__td>
$maybe mappingWgt <- occurrenceMapping examOccurrenceName
^{mappingWgt}
$if showRegisteredCount
<td .table__td>#{rCount}
<td .table__td>
$maybe desc <- examOccurrenceDescription
#{desc}
<tfoot>
<tr .table__row .table__row--sum>
$if occurrenceNamesShown
<td>
$if is _Nothing examRoom
<td>
$if not examTimes
<td>
$if showOccurrenceRegisterColumn
<td>
$if showOccurrenceMappingColumn
<td>
$if showRegisteredCount
<td .table__td>
$if sumRegisteredCount == registeredCount
#{sumRegisteredCount}
$else
_{MsgExamRegisteredCountOf sumRegisteredCount registeredCount}
<td>
$if (gradingShown || partsShown) && not (null examParts)
<section>
<h2>
_{MsgExamParts}
$if (gradingShown && not gradingVisible) || (partsShown && not partsVisible)
\ ^{isVisible False}
<table .table .table--striped .table--hover >
<thead>
<tr .table__row .table__row--head>
$if partNumbersShown
<th .table__th>
_{MsgExamPartNumber} ^{isVisible False}
<th .table__th>_{MsgExamPartName}
$if showPartSheets
<th .table__th>_{MsgExamPartSheets}
$if showMaxPoints
<th .table__th>_{MsgExamPartMaxPoints}
$if showAchievedPoints
<th .table__th>_{MsgExamPartResultPoints}
<tbody>
$forall (Entity partId ExamPart{examPartNumber, examPartName, examPartWeight, examPartMaxPoints}, cID, partSheets) <- examParts
<tr .table__row ##{toPathPiece cID}>
$if partNumbersShown
<td .table__td>#{examPartNumber}
<td .table__td>
$maybe pName <- examPartName
#{pName}
$nothing
_{MsgExamPartNumbered examPartNumber}
$if showPartSheets
<td .table__td>
$if not (null partSheets)
<ul .list--inline .list--comma-separated>
$forall Entity _ Sheet{sheetName} <- partSheets
<li>
<a href=@{CSheetR tid ssh csh sheetName SShowR}>
#{sheetName}
$if showMaxPoints
<td .table__td>
$maybe mPoints <- examPartMaxPoints
#{showFixed True (fromRational examPartWeight * mPoints)}
$if showAchievedPoints
<td .table__td>
$case fmap (examPartResultResult . entityVal) (results !? partId)
$of Nothing
$of Just (ExamAttended ps)
#{showFixed True ps}
$of Just ExamNoShow
_{MsgExamNoShow}
$of Just ExamVoided
_{MsgExamVoided}
<tfoot>
$maybe mPoints <- fmap (examBonusBonus . entityVal) bonus
$if showMaxPoints
<tr .table__row .table__row--sum>
$if partNumbersShown
<td>
<td>
$if showPartSheets
<td>
<td .table__td>
#{showFixed True sumMaxPoints}
<td>
<tr .table__row>
$if partNumbersShown
<td .table__td>
<td .table__td>
<a href=@{CourseR tid ssh csh SheetListR}>
_{MsgExamBonusAchieved}
$if showPartSheets
<td>
$if showMaxPoints
<td .table__td>
$if showAchievedPoints
<td .table__td :noBonus:.no-bonus>
#{showFixed True mPoints}
<tr .table__row .table__row--sum>
$if partNumbersShown
<td>
<td>
$if showPartSheets
<td>
$if showMaxPoints
<td>
$if showAchievedPoints
<td .table__td>
$case sumPoints
$of ExamAttended ps
#{showFixed True ps}
$of _
$nothing
<tr .table__row .table__row--sum>
$if partNumbersShown
<td>
<td>
$if showPartSheets
<td>
$if showMaxPoints
<td .table__td>
#{showFixed True sumMaxPoints}
$if showAchievedPoints
<td .table__td>
$case sumPoints
$of ExamAttended ps
#{showFixed True ps}
$of _
$# TODO: Statistics