You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have defined the *test form below for use in checkers. It's a bit clunky with one popup per failing test on the client side, but it does the job. Unfortunately I discovered a problem where student exception messages (extracted via exn-message) contain substrings like {post}. This seems to trigger the substitution mechanism, I think in prefix-line/substs. Since it doesn't correspond to a defined substitution, this causes the checker to crash part way through writing out the text file.
I guess some form of escaping is needed, either in my code or in add-header-line!, but that would also need to be handled in subst. Suggestions for workarounds gratefully received.
(define-syntax *test
(syntax-rules ()
[(_ expr result)
(*test expr result equal?)]
[(_ expr result equal?)
(with-handlers
([exn?
(λ (exn)
(add-header-line! "Test failure: <-10>")
(add-header-line! (format " --> ~a" (exn-message exn)))
(message (string-append
(exn-message exn)
"\nThe submission has been saved with a 10% penalty."" Fix the test and resubmit to improve your grade")
'(ok))
(message "Handin saved with penalty."'final))
])
(!test expr result equal?))]))
The text was updated successfully, but these errors were encountered:
Actually, I think that what's required is a breaking change; if I recall correctly, the current interface has no way to distinguish between "trusted" and "untrusted" strings, and therefore no way to substitute only in the places where the instructor wants the substitution to occur. I think the obvious fix is to separate the substitution into a separate function.
I have defined the
*test
form below for use in checkers. It's a bit clunky with one popup per failing test on the client side, but it does the job. Unfortunately I discovered a problem where student exception messages (extracted viaexn-message
) contain substrings like{post}
. This seems to trigger the substitution mechanism, I think inprefix-line/substs
. Since it doesn't correspond to a defined substitution, this causes the checker to crash part way through writing out the text file.I guess some form of escaping is needed, either in my code or in add-header-line!, but that would also need to be handled in subst. Suggestions for workarounds gratefully received.
The text was updated successfully, but these errors were encountered: