[racket] Writing checkers for handin-server

From: Suzanne Menzel (menzel at indiana.edu)
Date: Tue Jan 6 16:33:04 EST 2015

I’m trying to set up the handin-server to use in my class this semester and I’ve run into a few problems that I hope someone can help with.

I’ve got the server up and running and the Handin button appears in DrRacket. I currently have only one assignment, called a1. Everything works fine when submitting this sample homework file (on the client machine):

;; contents of student submission a1.rkt
(check-expect (double-inc 4) 9)
(check-expect (double-inc 0) 1)

(define (double-inc x)
  (add1 (* 2 x)))

with this checker (on the server machine):

;; contents of a1/checker.rkt
(module checker handin-server/checker
  (require handin-server/grading-utils)
  (pre:
   (check-deadline))

  (check: :language  '(special beginner)
   (update-submission-timestamp!)
   (add-header-line! (get-submission-timestamp))
   (add-report-line! (get-submission-timestamp))

   (!test (double-inc 2) 5)
   (!test (double-inc 3) 7)
   (!test (double-inc 0) 1)
   (!test (double-inc -5) -9))

  (post:                                                           
   #f)
  )

So far, so good. Now, I want to add a !procedure check before the tests for double-inc, like this:

(!procedure double-inc 1)

This produces the following error:

submit error: while evaluating double-inc:
  eval:1:0: double-inc: expected a function call, but there is no open parenthesis before this function
  in: double-inc

So, I change the language to (special advanced) and the error goes away. This brings me to my first question:

(1) How can I set it up so that the checker runs in racket and the evaluator for the tests run in BSL (for example)?

Next, I tried putting in the coverage check. 

coverage? #t

This produces the error (even though all lines are covered by check-expects):

submit error: your code is not completely covered by tests: uncovered expression at 1:0 ()

(2) How can I get the coverage check to work?

Finally, I tried putting write-report in the post:

(write-report)

And here’s the error:

commit error: start-timer: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 3
  given: 2
  arguments...:
   0
   #<procedure>

(3) What’s up with the error from start-timer?!

Any advice would be greatly appreciated. Also, if anyone has any sample checkers that they wouldn’t mind sharing with me, that would be terrific. I’d love to see what others have already developed.

Thanks,
Suzanne

––––––––––––––––––––––––––––––––––––

For completeness, here’s my config.rktd:

((active-dirs ("a1"))
 (port-number 17979)
 (use-https #t)
 (session-timeout 500) ;; default is 300                                            
 (session-memory-limit 40000000)
 (allow-web-upload #f)
 (default-file-name "handin.rkt")
 (max-upload 500000)
 (max-upload-keep 5)
 (user-regexp #rx"^[a-z][a-z0-9]+$")
 (user-desc "alphanumeric string")
 (username-case-sensitive #f)
 (allow-new-users #t)
 (allow-change-info #t)
 (master-password "9f8699ae058b59f72f179789519817fb") ;; default is #f              
 (log-output #t)
 (log-file "log")
 (web-log-file "web-log") ;; default is #f                                          
 (extra-fields
  (("Full Name"
    #rx"^[A-Z][a-zA-Z-]+(?: [A-Z][a-zA-Z-]+)+$"
    "your full name, no punctuation, properly capitalized")
   ("Email"
    #rx"^[a-z]+[0-9]*@(indiana|iupui|iupuc|iue|iuk|iun|iusb|ius)\\.edu$"
    "your Indiana University email address")
   ("Lab Section"
    ("A" "B" "C" "D" "E" "F" "G" "H")
    "the name of the lab in which you are enrolled: A, B, C, D, E, F, G, or H")))
 (hook-file "hook.rkt")
 (deadline (("a1" (2015 1 20 23 59 59) 9)))
 )





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150106/f55c9442/attachment.html>

Posted on the users mailing list.