Beispiel für Felix' Frage zu !163

This commit is contained in:
Steffen Jost 2019-03-24 11:46:46 +01:00
parent c430649d0c
commit e0bc7a5615
2 changed files with 7 additions and 8 deletions

View File

@ -25,12 +25,11 @@ gradeSummaryWidget title sts =
hasMarkedPasses = positiveSum $ numMarkedPasses sumSummaries
hasPoints = positiveSum $ numSheetsPoints sumSummaries
hasMarkedPoints = positiveSum $ numMarkedPoints sumSummaries
rowWdgts = [ $(widgetFile "widgets/grading-summary/grading-summary-row")
| (sumHeader,summary) <-
[ (MsgSheetTypeNormal' ,normalSummary)
, (MsgSheetTypeBonus' ,bonusSummary)
, (MsgSheetTypeInformational' ,informationalSummary)
] ]
rowWdgt sumHeader summary = $(widgetFile "widgets/grading-summary/grading-summary-row") -- diese Funktonsdefinition darf leider nicht im .hamlet stehen!
rowsShown = [ (MsgSheetTypeNormal' ,normalSummary)
, (MsgSheetTypeBonus' ,bonusSummary)
, (MsgSheetTypeInformational' ,informationalSummary)
] -- diese Liste könnte auch im .hamlet definiert werden
in if 0 == numSheets sumSummaries
then mempty
else $(widgetFile "widgets/grading-summary/grading-summary")

View File

@ -24,8 +24,8 @@ $# --
<th .table__th>_{MsgSheetGradingPoints'}
<th .table__th>_{MsgSheetGradingCount'}
$# Number of Sheet/Submissions used for calculating maximum passes/points
$forall row <- rowWdgts
^{row}
$forall (headMsg, summaryVal) <- rowsShown
^{rowWdgt headMsg summaryVal}
$maybe nrNoGrade <- positiveSum $ numNotGraded
<tr .table__row>
<th .table__th>_{MsgSheetTypeNotGraded}