Handin-Server Grading Utilities: write-report's start-timer

19 views
Skip to first unread message

mat...@udel.edu

unread,
Aug 26, 2015, 5:53:31 PM8/26/15
to Racket Developers
Hello,

I was wondering if someone could help me with the following. I'm setting up the handin collection for a class. 

When I submit the code to my handin-server I get the following error:

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

-END ERROR MESSAGE-----------------------------

I traced the issue to the write-report function in the config file. Inside of write-report a start-timer function call is made with 2 arguments. The start-timer function consumes 3 arguments per the documentation here: http://docs.racket-lang.org/web-server-internal/timer.html?q=start-timer#%28def._%28%28lib._web-server%2Fprivate%2Ftimer..rkt%29._start-timer%29%29

I opened up the write-report's definition in the grading-utilities.rkt and here is the call to start-timer which seems to be missing a parameter:

(start-timer (* 60 report-delay)
                        (thunk
                         (with-output-to-file
                             (build-path dir 
                                         (format "~a-report-~a.txt"
                                                 (string-join users "+")                                        
                                                 ts))
                           #:exists 'replace
                           (thunk (display report-string)))))

I'm not sure what to do now. Any suggestions? Below are my files.


------Student Submission-------
(define (bar x y)
 
(+ x y))

------CONFIG file-----------------
((active-dirs ("test"))
 
(deadline (("test" (2016 3 11 23 59 59) 3)))
 
(max-submissions (("test" 200)))
)

------CHECKER.rkt-------------------
(module checker handin-server/checker
 
 
(require handin-server/grading-utils)
 
 
; Checks that submission is on time and that the user has submissions left
 
(pre:
   
(check-deadline)
   
(check-max-submissions))
 
 
; Ends the report by adding the score and writes it in the user directory
 
; This way, students can see their reports from the web interface.
 
(post:
   
(add-score-to-report!)
   
(write-report))
 
 
(check:
   
; Get timestamp of the submission and add it to header and report
   
:language  '(special intermediate)
   (update-submission-timestamp!)
   (add-header-line! (get-submission-timestamp))
   (add-report-line! (get-submission-timestamp))

   ; Grading
 
   ; Initialize max score
   (set-test-max-score! 100)
 
   ; Failure discounts 25 points
   (@test "Sample case 1"
          "Error using even? predicate"
          (bar 1 3)
          4
          25)
   ))



John Clements

unread,
Aug 26, 2015, 7:13:30 PM8/26/15
to mat...@udel.edu, Racket Developers, Jay McCarthy
It looks like the ‘tm’ argument to start-timer is missing. My guess is that the ‘tm’ argument was added to the start-timer definition since the last time the ‘write-report’ function was used. My guess is that the handin-server should create (or obtain?) a timer manager using (start-timer-manager) when it’s started. I’m guessing Jay McCarthy knows more about this.

John Clements



Matthew Saponaro

unread,
Aug 27, 2015, 3:12:27 PM8/27/15
to John Clements, Racket Developers, Jay McCarthy
This is correct. If you modify the grading-utilities to incorporate the (start-timer-manager) call this will work. 

I think it may be reasonable to modify the github handin accordingly. 

In addition, I think there are some typos in the documentation: http://pkg-build.racket-lang.org/doc/handin-server/grading-utils.html

Note: test instead of @test in the code example provided. 

Note: The check is missing the language specification in the code example provided. 
(check:

:language  '(special intermediate)

...)

These are just some notes that I would like to post here. I'm not sure where they may be best suited, but hopefully someone can redirect these issues to the correct individual(s).


'John Clements' via dev-redirect

unread,
Aug 28, 2015, 1:08:45 PM8/28/15
to Matthew Saponaro, d...@racket-lang.org

> On Aug 27, 2015, at 3:16 PM, Matthew Saponaro <mat...@udel.edu> wrote:
>
> On Thu, Aug 27, 2015 at 4:10 PM, John Clements <clem...@brinckerhoff.org> wrote:
>
> > On Aug 27, 2015, at 12:12 PM, Matthew Saponaro <mat...@udel.edu> wrote:
> >
> > This is correct. If you modify the grading-utilities to incorporate the (start-timer-manager) call this will work.
>
> Can you pass along the changes that you made? A pull request would be great, but any kind of diff would probably work.
> >
> > I think it may be reasonable to modify the github handin accordingly.
> >
> > In addition, I think there are some typos in the documentation: http://pkg-build.racket-lang.org/doc/handin-server/grading-utils.html
> >
> > Note: test instead of @test in the code example provided.

Hmm… did you mean ‘!test’, or ‘@test’ ?

John Clements



Matthew Saponaro

unread,
Aug 28, 2015, 2:56:20 PM8/28/15
to John Clements, d...@racket-lang.org
I was under the impression it should be @test since it's penalizing the score and updating the report. The example code has a section already dedicated to acceptance testing. 

'John Clements' via dev-redirect

unread,
Aug 28, 2015, 5:48:09 PM8/28/15
to Jay McCarthy, Matthew Saponaro, d...@racket-lang.org

> On Aug 28, 2015, at 1:07 PM, Jay McCarthy <jay.mc...@gmail.com> wrote:
>
> Sorry for the delay in my response... this seems right to me. Is that
> commit pushed? Can I do anything to help?

There’s a PR open against plt/handin:

https://github.com/plt/handin/pull/18

It turns out I don’t have write access to the “plt” repos. Perhaps you do?

John

>
> Jay
> --
> Jay McCarthy
> http://jeapostrophe.github.io
>
> "Wherefore, be not weary in well-doing,
> for ye are laying the foundation of a great work.
> And out of small things proceedeth that which is great."
> - D&C 64:33



Jay McCarthy

unread,
Aug 28, 2015, 6:39:00 PM8/28/15
to John Clements, Matthew Saponaro, dev
I do not. I'll ask around.

Jay
> --
> You received this message because you are subscribed to the Google Groups "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-dev+...@googlegroups.com.
> To post to this group, send email to racke...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/aa2e7590-2ab9-4ee6-8178-0f9721d0ce1f%40mtasv.net.
> For more options, visit https://groups.google.com/d/optout.

'John Clements' via dev-redirect

unread,
Aug 28, 2015, 7:03:58 PM8/28/15
to Matthew Saponaro, d...@racket-lang.org

> On Aug 27, 2015, at 3:16 PM, Matthew Saponaro <mat...@udel.edu> wrote:
>
> Here's the diff for the documentation online. I did it with an online tool since it's just text from online: https://www.diffchecker.com/qolqblvq
>
> Attached is the diff I generated using git on the repository.

Many thanks for your help! The changes you suggest are now both a part of the handin-server repo.

John Clements



Reply all
Reply to author
Forward
0 new messages