fradrive/templates/widgets/rating/rating.hamlet
2021-01-18 14:19:02 +01:00

25 lines
790 B
Plaintext

$# Display Rating, expects
$# sub :: Submission
$# submissionRatingDone :: Submission -> Bool
$# submissionRatingPoints :: Maybe points
$if submissionRatingDone sub
$maybe (grading, points) <- mTuple (preview _grading sheetType) submissionRatingPoints
$case grading
$of Points{..}
_{MsgAchievedOf points maxPoints}
$of PassPoints{maxPoints}
$if fromMaybe False (gradingPassed grading points)
_{MsgPassed}, _{MsgAchievedOf points maxPoints}
$else
_{MsgNotPassed}, _{MsgAchievedOf points maxPoints}
$of PassBinary
$if fromMaybe False (gradingPassed grading points)
_{MsgPassed}
$else
_{MsgNotPassed}
$of PassAlways
#{hasTickmark True}
$nothing
#{hasTickmark True}