From 5e78c729407999bd26af4d446edf0edf7d0af94e Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Thu, 13 Sep 2018 13:09:35 -0400 Subject: Import autograder from 15-317 f17 --- skel/checks.sml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 skel/checks.sml (limited to 'skel/checks.sml') 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 *) +(* 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 -- cgit v1.2.3