This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/templates/widgets/rating/rating.hamlet
2021-04-02 15:53:10 +02:00

25 lines
832 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{..}
_{MsgRatingAchievedOf points maxPoints}
$of PassPoints{maxPoints}
$if fromMaybe False (gradingPassed grading points)
_{MsgRatingPassed}, _{MsgRatingAchievedOf points maxPoints}
$else
_{MsgRatingNotPassed}, _{MsgRatingAchievedOf points maxPoints}
$of PassBinary
$if fromMaybe False (gradingPassed grading points)
_{MsgRatingPassed}
$else
_{MsgRatingNotPassed}
$of PassAlways
#{hasTickmark True}
$nothing
#{hasTickmark True}