6.2 Utilities
(require handin-server/utils) | package: handin |
procedure
(make-evaluator/submission language require-paths content) β (any/c . -> . any)
language :
(or/c module-path? (list/c (one-of/c 'special) symbol?) (list/c (one-of/c 'module) module-path?) (cons/c (one-of/c 'begin) list?)) require-paths : (listof path-string?) content : bytes?
In addition to the language specification for make-evaluator, the language argument can be a list that begins with 'module. In this case, make-module-language is used to create an evaluator, and the module code must be using the specified language in its language position. In this case, the requires-paths argument is used only for paths that are allowed to be accessed (the allow-read argument to make-evaluator, since the submission is expected to be a complete submission.)
procedure
(call-with-evaluator language require-paths input-program proc) β any
language :
(or/c module-path? (list/c (one-of/c 'special) symbol?) (list/c (one-of/c 'module) module-path?) (cons/c (one-of/c 'begin) list?)) require-paths : (listof path-string?) input-program : any/c proc : (any/c . -> . any)
procedure
(call-with-evaluator/submission language require-paths submission proc) β any
language :
(or/c module-path? (list/c (one-of/c 'special) symbol?) (list/c (one-of/c 'module) module-path?) (cons/c (one-of/c 'begin) list?)) require-paths : (listof path-string?) submission : bytes? proc : (any/c . -> . any)
procedure
(evaluate-all source input-port eval) β any
source : any input-port : port? eval : (any/c . -> . any)
procedure
(evaluate-submission submission eval) β any
submission : bytes? eval : (any/c . -> . any)
procedure
(check-proc eval expect-v compare-proc proc-name arg ...) β any eval : (any/c . -> . any) expect-v : any/c compare-proc : (any/c any/c . -> . any) proc-name : symbol? arg : any/c
Every exception or result mismatch during the call to compare-proc is phrased suitably for the handin client.
procedure
(user-construct eval name arg ...) β any
eval : (any/c . -> . any) name : symbol? arg : any/c
parameter
(test-history-enabled) β any/c
(test-history-enabled on?) β void? on? : any/c
procedure
string : string? (message string styles) β void? string : string? styles : 'final (message string styles) β any string : string?
styles :
(listof (or/c 'ok 'ok-cancel 'yes-no 'caution 'stop))
In the second case, where 'final is used as a flag, does not
show the text immediately β
The third case, when styles is a list of symbols, opens a message-box dialog on the client side, and the resulting value is returned as the result of message. The styles list is passed as the style argument to message-box. You can use this to send warnings to the student or to ask for confirmation, for example, βyour submission does not pass 3 tests, continue?β.
procedure
(set-run-status status) β void?
status : (or/c false? string?)
parameter
(current-value-printer) β (any/c . -> . string?)
(current-value-printer proc) β void? proc : (any/c . -> . string?)
procedure
(reraise-exn-as-submission-problem thunk) β any
thunk : (-> any)
procedure
(timeout-control msg) β void?
msg : any?
procedure
procedure
(get-assignment-name) β string?
procedure
(get-submit-on-error?) β boolean?
value