problem with :user-error-message in handin server

13 views
Skip to first unread message

David Bremner

unread,
Jan 7, 2020, 3:59:51 PM1/7/20
to us...@racket-lang.org

Apologies if this appears twice. I sent the first one before being
subscribed, so suspect it might just have been black-holed by google.

I'm using the latest handin package for the handin server source,
installed with "raco pkg install handin". The server is running racket
7.2.

I'm trying to make the handin server accept erroneous submissions but
add a header line, following the example from the handin server
documentation I pass the following as :user-error-message

(lambda (msg)
(add-header-line! "Erroneous submission!")
(add-header-line! (format " --> ~a" msg))
(message (string-append
"You have an error in your program -- please hit"
" \"Run\" and debug your code.\n"
"Email the course staff if you think your code is"
" fine.\n"
"(The submission has been saved but marked as"
" erroneous.)")
'(ok))
(message "Handin saved as erroneous." 'final))

This cause the desired dialog box to pop up, but after I press OK I get
a "Server Error" popup "while evaluating #<evaluator-message>: application: not a procedure".

I don't really understand where the identifier "evaluator-message" is
defined, it shows up only in the .zo file for handin-server/checker.rkt.

In case it helps I attach the checker.rkt for the assignment in
question.

I'm triggering the error with a (/ 1 0) in the submission, but the type
of error does not seem to matter.

On a related topic, assuming I can get that to work, I'd like to do
something similar for !test. What's the easiest way to do that? Do I
need to use @test from the grading utilities? I basically just need to
call add-header-line! on test failure.

2020-01-07-155513_421x164_scrot.png
checker.rkt

David Bremner

unread,
Jan 8, 2020, 11:05:05 AM1/8/20
to us...@racket-lang.org
David Bremner <da...@tethera.net> writes:
>
> (lambda (msg)
> (add-header-line! "Erroneous submission!")
> (add-header-line! (format " --> ~a" msg))
> (message (string-append
> "You have an error in your program -- please hit"
> " \"Run\" and debug your code.\n"
> "Email the course staff if you think your code is"
> " fine.\n"
> "(The submission has been saved but marked as"
> " erroneous.)")
> '(ok))
> (message "Handin saved as erroneous." 'final))
>
> This cause the desired dialog box to pop up, but after I press OK I get
> a "Server Error" popup "while evaluating #<evaluator-message>: application: not a procedure".
>
> I don't really understand where the identifier "evaluator-message" is
> defined, it shows up only in the .zo file for handin-server/checker.rkt.

I still don't understand what's going on, but it seems contrary to the
documentation, the return value from the procedure passed as
:user-error-message matters, and apparently it should be a procedure
taking one argument.

If I use the following

:user-error-message (lambda (msg) (message msg '(ok))
(lambda (thing) (message (format "~a" thing) '(ok))))

then I get two popups from the handin client. The first has the error
message, and the second just has #<evaluator-message>.
Reply all
Reply to author
Forward
0 new messages