diff --git a/messages/uniworx/de.msg b/messages/uniworx/de.msg index cbc27001c..a8521f735 100644 --- a/messages/uniworx/de.msg +++ b/messages/uniworx/de.msg @@ -389,7 +389,8 @@ SheetTypeBonus grading@SheetGrading: Bonus SheetTypeNormal grading@SheetGrading: Normal SheetTypeInformational grading@SheetGrading: Keine Wertung SheetTypeNotGraded: Unbewertet -SheetTypeInfo: Bonus Blätter zählen, erhöhen aber nicht die maximal erreichbare Punktzahl bzw. Anzahl zu bestehender Blätter. Blätter ohne Wertung werden nirgends angerechnet, die Bewertung durch den Korrektor dient lediglich zur Information an die Teilnehmer. +SheetTypeInfo: Bonus Blätter zählen normal, erhöhen aber nicht die maximal erreichbare Punktzahl bzw. Anzahl zu bestehender Blätter. Blätter ohne Wertung werden nirgends angerechnet, die Bewertung durch den Korrektor dient lediglich zur Information an die Teilnehmer. +SheetGradingBonusIncluded: Erzielte Bonuspunkte wurden hier bereits zu den normalen Punkten hinzugezählt. SheetTypeBonus': Bonus SheetTypeNormal': Normal diff --git a/src/Handler/Corrections.hs b/src/Handler/Corrections.hs index 7a97f8b22..41375eab1 100644 --- a/src/Handler/Corrections.hs +++ b/src/Handler/Corrections.hs @@ -383,10 +383,10 @@ correctionsR whereClause (formColonnade -> displayColumns) psValidator actions = let route = CSubmissionR tid ssh csh shn cID SAssignR (== Authorized) <$> evalAccessDB route True -gradeSummaryWidget :: SheetTypeSummary -> Widget UniWorX IO () +gradeSummaryWidget :: SheetTypeSummary -> Widget gradeSummaryWidget sts = let SheetTypeSummary{..} = addBonusToPoints sts - sumSummaries = (normalSummary <> bonusSummary <> informationalSummary) # _numSheets %~ (<> numNotGraded) + sumSummaries = (normalSummary <> bonusSummary <> informationalSummary) -- # _numSheets %~ (<> numNotGraded) hasPassings = positiveSum $ numGradePasses sumSummaries hasPoints = positiveSum $ sumGradePoints sumSummaries rowWdgts = [ $(widgetFile "widgets/gradingSummaryRow") @@ -395,7 +395,9 @@ gradeSummaryWidget sts = , (MsgSheetTypeBonus' ,bonusSummary) , (MsgSheetTypeInformational' ,informationalSummary) ] ] - in $(widgetFile "widgets/gradingSummary") + in if 0 == numSheets sumSummaries + then mempty + else $(widgetFile "widgets/gradingSummary") type ActionCorrections' = (ActionCorrections, AForm (HandlerT UniWorX IO) ActionCorrectionsData) diff --git a/templates/widgets/gradingSummary.hamlet b/templates/widgets/gradingSummary.hamlet index 08f04b9e5..3967a8f37 100644 --- a/templates/widgets/gradingSummary.hamlet +++ b/templates/widgets/gradingSummary.hamlet @@ -1,27 +1,29 @@ $# Displays gradings Summary for various purposes $# --
| $# empty cell for row headers $maybe _ <- hasPassings - | _{MsgSheetGradingPassing'} + | _{MsgSheetGradingPassing'} $maybe _ <- hasPoints - | _{MsgSheetGradingPoints'} - | _{MsgSheetGradingCount'} + | _{MsgSheetGradingPoints'} + | _{MsgSheetGradingCount'} $# Number of Sheet/Submissions used for calculating maximum passes/points $forall row <- rowWdgts ^{row} $maybe nrNoGrade <- positiveSum $ numNotGraded - | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| _{MsgSheetTypeNotGraded} + | ||||||||||||||||||
| _{MsgSheetTypeNotGraded} $maybe _ <- hasPassings | $maybe _ <- hasPoints - | - | #{display nrNoGrade} + | + | #{display nrNoGrade}
$maybe _ <- positiveSum $ bonusSummary ^. _numSheets
_{MsgSheetTypeInfo} + _{MsgSheetGradingBonusIncluded} $nothing - _{MsgSheetTypeInfo} \ No newline at end of file + $maybe _ <- positiveSum $ informationalSummary ^. _numSheets + _{MsgSheetTypeInfo} \ No newline at end of file diff --git a/templates/widgets/gradingSummaryRow.hamlet b/templates/widgets/gradingSummaryRow.hamlet index 46e4375bb..01e63efeb 100644 --- a/templates/widgets/gradingSummaryRow.hamlet +++ b/templates/widgets/gradingSummaryRow.hamlet @@ -6,28 +6,28 @@ $# summary :: SheetGradeSummary -- summary to display $# sumHeader :: UniWorXMessage -- row header $# $maybe nrSheets <- positiveSum $ summary ^. _numSheets - | |||||||||||||
| _{sumHeader} + | ||||||||||||||||||
| _{sumHeader} $maybe _ <- hasPassings - $with Sum pmax <- sumHeader ^. _numGradePasses + $with Sum pmax <- summary ^. _numGradePasses $maybe Sum pacv <- summary ^. _achievedPasses - | + | $if pmax /= 0 #{textPercentInt pacv pmax} - | + | #{display pacv} / #{display pmax} $nothing - | + | #{display pmax } $maybe _ <- hasPoints - $with Sum pmax <- sumHeader ^. _sumGradePoints + $with Sum pmax <- summary ^. _sumGradePoints $maybe Sum pacv <- summary ^. _achievedPoints - | + | $if pmax /= 0 #{textPercent $ realToFrac $ pacv / pmax} - | + | #{display pacv} / #{display pmax} $nothing - | + | #{display pmax } - | #{display nrSheets} \ No newline at end of file + | #{display nrSheets} \ No newline at end of file | ||||