(* CS 2SC3 / SE 2S03 automated marking for assign 1 -- Pouya Larjani *) open Students open Marking let title, ex, files, log, sol = "1", "assign1", ["prog1.ml"], ["log1.txt"], ["sol1.ml"] let tests = ["-5 1"; "0 4"; "1 111111"; "-3 0"; "0 0"; "0.0000001 0"; "-5 -1"; "0 -77.7"; "0.000001 -0.00001"; "infinity infinity"] let fs = List.length files let ss = get_students() let ssl = List.length ss let rec get_ta s = function [] -> "larjanp" | s'::t when s = s' -> (match 3 * (List.length t) / ssl with 2 -> "dreezerj" | 1 -> "sakyika" | _ -> "zhanghy2") | _::t -> get_ta s t let check_submission s = copy_files s ex sol; res_header s ex title None ((get_ta s ss) ^ "@mcmaster.ca"); res_section "1. Objective"; let a1 = check_files s ex files in res_mark "(a) Program file is present" (Some (10*a1)) 10; let b1 = check_compiles s ex "ocamlc" files in res_mark "(b) Program compiles" (Some (10*b1)) 10; let c1 = check_runs s ex "ocamlc" "p1" files in res_mark "(c) Program runs" (Some (if c1 = -1 then 0 else 10)) 10; let d1 = check_output s ex "p1" in res_mark "(d) Program prints test results" (Some (10*d1)) 10; let e1 = check_cases s ex "ocamlc" "t1" (files @ sol) tests in res_mark "(e) Program passes objective tests" (Some (if e1 > 0 then 2*e1 else 0)) 20; res_section "2. Subjective"; res_mark "(a) Program satisfies the requirements" None 20; res_mark "(b) Choice of test inputs" None 10; res_mark "(c) Quality of print out of test results" None 10; res_mark "(d) Style (comments only)" None 0; res_newline ""; res_section "3. Penalties"; let a3 = check_files s ex log in res_mark "(a) Missing or substandard log file" (Some (a3 * 10 - 10)) (-10); let b3 = check_ontime s ex "2009-10-02 11:59" files in res_mark "(b) Late" (Some (if b3 = fs then 0 else -100)) (-100); attach_files s ex (files @ log); res_footer () let check_all () = List.iter check_submission ss let sendmail_all () = List.iter (fun s -> send_email s ex) ss (*check_all();;*) (*sendmail_all();;*)