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

View File

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