Created
February 22, 2013 20:46
-
-
Save lmazardo/5016424 to your computer and use it in GitHub Desktop.
grading in coursera programming languages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatype note = ProgrammingAssignments of int list | |
| PeerAssignments of int list | |
| Exam of int list | |
| Note of note list | |
fun grading n = | |
case n of | |
ProgrammingAssignments pl => (case pl of | |
[] => 0.0 | |
| x::xs => 0.9 * Real.fromInt(x) + grading (ProgrammingAssignments xs)) | |
| PeerAssignments pa => (case pa of | |
[] => 0.0 | |
| x::xs => 0.1 * Real.fromInt(x) + grading (PeerAssignments xs)) | |
| Exam e => (case e of | |
[] => 0.0 | |
| x::xs => 0.15 * Real.fromInt(x) + grading (Exam xs)) | |
| Note n => (case n of | |
[] => 0.0 | |
| x::xs => grading x + grading (Note xs)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment