Tooltips clarifying sheetTypes and sheetGrading at sheet creation
This commit is contained in:
parent
73bd8bf9f0
commit
d6ef0c1b65
@ -356,6 +356,7 @@ SheetGrading: Bewertung
|
||||
SheetGradingPoints maxPoints@Points: #{tshow maxPoints} Punkte
|
||||
SheetGradingPassPoints maxPoints@Points passingPoints@Points: Bestanden ab #{tshow passingPoints} von #{tshow maxPoints} Punkten
|
||||
SheetGradingPassBinary: Bestanden/Nicht Bestanden
|
||||
SheetGradingInfo: "Bestanden nach Punkten" zählt sowohl zur maximal erreichbaren Gesamtpunktzahl also auch zur Anzahl der zu bestehenden Blätter.
|
||||
|
||||
SheetGradingPoints': Punkte
|
||||
SheetGradingPassPoints': Bestehen nach Punkten
|
||||
@ -365,6 +366,7 @@ 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 nicht angerechnet, eine Punktangabe dient dort nur zur Rückmeldung an die Teilnehmer.
|
||||
|
||||
SheetTypeBonus': Bonus
|
||||
SheetTypeNormal': Normal
|
||||
|
||||
@ -102,7 +102,8 @@ makeSheetForm msId template = identForm FIDsheet $ \html -> do
|
||||
(result, widget) <- flip (renderAForm FormStandard) html $ SheetForm
|
||||
<$> areq ciField (fslI MsgSheetName) (sfName <$> template)
|
||||
<*> aopt htmlField (fslI MsgSheetDescription) (sfDescription <$> template)
|
||||
<*> sheetTypeAFormReq (fslI MsgSheetType) (sfType <$> template)
|
||||
<*> sheetTypeAFormReq (fslI MsgSheetType
|
||||
& setTooltip MsgSheetTypeInfo) (sfType <$> template)
|
||||
<*> sheetGroupAFormReq (fslI MsgSheetGroup) (sfGrouping <$> template)
|
||||
<*> aopt utcTimeField (fslI MsgSheetVisibleFrom
|
||||
& setTooltip MsgSheetVisibleFromTip)
|
||||
|
||||
@ -391,7 +391,8 @@ sheetTypeAFormReq fs template = multiActionA fs selOptions (classify' <$> templa
|
||||
, ( Informational', Informational <$> gradingReq )
|
||||
, ( NotGraded', pure NotGraded )
|
||||
]
|
||||
gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading) (template >>= preview _grading)
|
||||
gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading
|
||||
& setTooltip MsgSheetGradingInfo) (template >>= preview _grading)
|
||||
|
||||
classify' :: SheetType -> SheetType'
|
||||
classify' = \case
|
||||
|
||||
@ -132,6 +132,16 @@ gradingPassed (Points {}) _ = Nothing
|
||||
gradingPassed (PassPoints {..}) pts = Just $ pts >= passingPoints
|
||||
gradingPassed (PassBinary {}) pts = Just $ pts /= 0
|
||||
|
||||
-- just for SheetTypeSummary (no lenses available here?!)
|
||||
getMaxPoints :: SheetGrading -> Points
|
||||
getMaxPoints PassBinary = 0
|
||||
getMaxPoints other = maxPoints other
|
||||
|
||||
getPassPoints :: SheetGrading -> Points
|
||||
getPassPoints PassPoints {..} = passingPoints
|
||||
getPassPoints _ = 0
|
||||
|
||||
|
||||
|
||||
data SheetType
|
||||
= Bonus { grading :: SheetGrading }
|
||||
@ -152,6 +162,7 @@ data SheetTypeSummary = SheetTypeSummary
|
||||
{ sumBonusPoints :: Sum Points
|
||||
, sumNormalPoints :: Sum Points
|
||||
, numPassSheets :: Sum Int
|
||||
, numPassBonus :: Sum Int
|
||||
, numNotGraded :: Sum Int
|
||||
, achievedBonus :: Maybe (Sum Points)
|
||||
, achievedNormal :: Maybe (Sum Points)
|
||||
@ -164,12 +175,14 @@ instance Monoid SheetTypeSummary where
|
||||
|
||||
|
||||
sheetTypeSum :: (SheetType, Maybe Points) -> SheetTypeSummary
|
||||
sheetTypeSum = error "TODO sheetTypeSum"
|
||||
-- sheetTypeSum (Bonus{..}, achieved) = mempty { sumBonusPoints = Sum $ fromMaybe 0 (grading ^? _maxPoints), achievedBonus = Sum <$> achieved }
|
||||
sheetTypeSum = error "TODO"
|
||||
{-
|
||||
sheetTypeSum (Bonus{..}, achieved) = mempty { sumBonusPoints = Sum maxPoints, achievedBonus = Sum <$> achieved }
|
||||
sheetTypeSum (Normal{..}, achieved) = mempty { sumNormalPoints = Sum maxPoints, achievedNormal = Sum <$> achieved }
|
||||
sheetTypeSum (Pass{..}, achieved) = mempty { numPassSheets = Sum 1, achievedPasses = Sum . bool 0 1 . (passingPoints <=) <$> achieved}
|
||||
sheetTypeSum (NotGraded, _ ) = mempty { numNotGraded = Sum 1 }
|
||||
sheetTypeSum (Bonus{..}, achieved) = mempty { sumBonusPoints = Sum $ getMaxPoints grading
|
||||
, achievedBonus = Sum <$> achieved }
|
||||
sheetTypeSum (Normal{..}, achieved) = mempty { sumNormalPoints = Sum $ getMaxPoints grading, achievedNormal = Sum <$> achieved }
|
||||
sheetTypeSum (Informational{..}, achieved) = mempty { }
|
||||
sheetTypeSum (NotGraded, _ ) = mempty { numNotGraded = Sum 1 }
|
||||
-}
|
||||
|
||||
data SheetGroup
|
||||
|
||||
Loading…
Reference in New Issue
Block a user