diff options
author | Ryan Kavanagh <rak@debian.org> | 2018-09-13 13:09:35 -0400 |
---|---|---|
committer | Ryan Kavanagh <rak@debian.org> | 2018-09-13 13:49:07 -0400 |
commit | 5e78c729407999bd26af4d446edf0edf7d0af94e (patch) | |
tree | 8e44695c03bd8974e4a9b0831272e845ffa940ad /skel/checks.sml |
Import autograder from 15-317 f17
Diffstat (limited to 'skel/checks.sml')
-rw-r--r-- | skel/checks.sml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/skel/checks.sml b/skel/checks.sml new file mode 100644 index 0000000..a62efe8 --- /dev/null +++ b/skel/checks.sml @@ -0,0 +1,36 @@ +(* Copyright (C) 2017 Ryan Kavanagh <rkavanagh@cs.cmu.edu> *) +(* Distributed under the ISC license, see COPYING for details. *) + +functor ChecksHelper (structure H : HELPER) : CHECKS where type checks = H.checks = +struct + +datatype checks = datatype H.checks + +(*****************************************************) +(********** CONFIGURE ME HERE *******) +(*****************************************************) + +val requiredFiles = ["hw0.pdf", "ex1.tut", "ex2.tut"] + +(* Returns the score l + h *) +fun check1 l h : real = l + h + +(* Is evil and always gives the student 0.0 *) +fun check2 () = 0.0 + +(* We first make sure all of the required files exist. *) +(* We then grade AutoLab problem "ex1" using the test1 function. *) +(* Finally, we grade AutoLab problem "ex2". *) +val checks = [ H.Check ("all files present", fn _ => H.checkFilesExist requiredFiles) + , H.Check ("hw0.pdf", fn _ => H.checkPDF "hw0.pdf") + , H.Problem ("ex1", fn _ => check1 3.0 4.0) + , H.Problem ("ex2", fn _ => check2 ()) ] + +(* Empty scoreboard *) +fun scoreboard _ = NONE + +(*****************************************************) +(********** END CONFIGURATION *******) +(*****************************************************) + +end |