Tooltips clarifying sheetTypes and sheetGrading at sheet creation

This commit is contained in:
SJost 2018-10-31 17:07:19 +01:00
parent 73bd8bf9f0
commit d6ef0c1b65
4 changed files with 24 additions and 7 deletions

View File

@ -356,6 +356,7 @@ SheetGrading: Bewertung
SheetGradingPoints maxPoints@Points: #{tshow maxPoints} Punkte SheetGradingPoints maxPoints@Points: #{tshow maxPoints} Punkte
SheetGradingPassPoints maxPoints@Points passingPoints@Points: Bestanden ab #{tshow passingPoints} von #{tshow maxPoints} Punkten SheetGradingPassPoints maxPoints@Points passingPoints@Points: Bestanden ab #{tshow passingPoints} von #{tshow maxPoints} Punkten
SheetGradingPassBinary: Bestanden/Nicht Bestanden 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 SheetGradingPoints': Punkte
SheetGradingPassPoints': Bestehen nach Punkten SheetGradingPassPoints': Bestehen nach Punkten
@ -365,6 +366,7 @@ SheetTypeBonus grading@SheetGrading: Bonus
SheetTypeNormal grading@SheetGrading: Normal SheetTypeNormal grading@SheetGrading: Normal
SheetTypeInformational grading@SheetGrading: Keine Wertung SheetTypeInformational grading@SheetGrading: Keine Wertung
SheetTypeNotGraded: Unbewertet 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 SheetTypeBonus': Bonus
SheetTypeNormal': Normal SheetTypeNormal': Normal

View File

@ -102,7 +102,8 @@ makeSheetForm msId template = identForm FIDsheet $ \html -> do
(result, widget) <- flip (renderAForm FormStandard) html $ SheetForm (result, widget) <- flip (renderAForm FormStandard) html $ SheetForm
<$> areq ciField (fslI MsgSheetName) (sfName <$> template) <$> areq ciField (fslI MsgSheetName) (sfName <$> template)
<*> aopt htmlField (fslI MsgSheetDescription) (sfDescription <$> template) <*> aopt htmlField (fslI MsgSheetDescription) (sfDescription <$> template)
<*> sheetTypeAFormReq (fslI MsgSheetType) (sfType <$> template) <*> sheetTypeAFormReq (fslI MsgSheetType
& setTooltip MsgSheetTypeInfo) (sfType <$> template)
<*> sheetGroupAFormReq (fslI MsgSheetGroup) (sfGrouping <$> template) <*> sheetGroupAFormReq (fslI MsgSheetGroup) (sfGrouping <$> template)
<*> aopt utcTimeField (fslI MsgSheetVisibleFrom <*> aopt utcTimeField (fslI MsgSheetVisibleFrom
& setTooltip MsgSheetVisibleFromTip) & setTooltip MsgSheetVisibleFromTip)

View File

@ -391,7 +391,8 @@ sheetTypeAFormReq fs template = multiActionA fs selOptions (classify' <$> templa
, ( Informational', Informational <$> gradingReq ) , ( Informational', Informational <$> gradingReq )
, ( NotGraded', pure NotGraded ) , ( NotGraded', pure NotGraded )
] ]
gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading) (template >>= preview _grading) gradingReq = sheetGradingAFormReq (fslI MsgSheetGrading
& setTooltip MsgSheetGradingInfo) (template >>= preview _grading)
classify' :: SheetType -> SheetType' classify' :: SheetType -> SheetType'
classify' = \case classify' = \case

View File

@ -132,6 +132,16 @@ gradingPassed (Points {}) _ = Nothing
gradingPassed (PassPoints {..}) pts = Just $ pts >= passingPoints gradingPassed (PassPoints {..}) pts = Just $ pts >= passingPoints
gradingPassed (PassBinary {}) pts = Just $ pts /= 0 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 data SheetType
= Bonus { grading :: SheetGrading } = Bonus { grading :: SheetGrading }
@ -152,6 +162,7 @@ data SheetTypeSummary = SheetTypeSummary
{ sumBonusPoints :: Sum Points { sumBonusPoints :: Sum Points
, sumNormalPoints :: Sum Points , sumNormalPoints :: Sum Points
, numPassSheets :: Sum Int , numPassSheets :: Sum Int
, numPassBonus :: Sum Int
, numNotGraded :: Sum Int , numNotGraded :: Sum Int
, achievedBonus :: Maybe (Sum Points) , achievedBonus :: Maybe (Sum Points)
, achievedNormal :: Maybe (Sum Points) , achievedNormal :: Maybe (Sum Points)
@ -164,12 +175,14 @@ instance Monoid SheetTypeSummary where
sheetTypeSum :: (SheetType, Maybe Points) -> SheetTypeSummary 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 (Bonus{..}, achieved) = mempty { sumBonusPoints = Sum $ getMaxPoints grading
sheetTypeSum (Normal{..}, achieved) = mempty { sumNormalPoints = Sum maxPoints, achievedNormal = Sum <$> achieved } , achievedBonus = Sum <$> achieved }
sheetTypeSum (Pass{..}, achieved) = mempty { numPassSheets = Sum 1, achievedPasses = Sum . bool 0 1 . (passingPoints <=) <$> achieved} sheetTypeSum (Normal{..}, achieved) = mempty { sumNormalPoints = Sum $ getMaxPoints grading, achievedNormal = Sum <$> achieved }
sheetTypeSum (NotGraded, _ ) = mempty { numNotGraded = Sum 1 } sheetTypeSum (Informational{..}, achieved) = mempty { }
sheetTypeSum (NotGraded, _ ) = mempty { numNotGraded = Sum 1 }
-} -}
data SheetGroup data SheetGroup