make LOG available for user code
svn: r1023
This commit is contained in:
parent
f9455176b7
commit
bedb4235c3
|
@ -629,6 +629,10 @@ The _utils.ss_ module provides utilities helpful in implementing
|
||||||
submission error.
|
submission error.
|
||||||
|
|
||||||
|
|
||||||
|
> (LOG fmt args ...) - produces a line in the server log file, using
|
||||||
|
the given format string and arguments.
|
||||||
|
|
||||||
|
|
||||||
Extra Checker Utilities
|
Extra Checker Utilities
|
||||||
============================================
|
============================================
|
||||||
|
|
||||||
|
@ -754,22 +758,25 @@ value from the submission code.
|
||||||
|
|
||||||
(require (lib "sendmail.ss" "net"))
|
(require (lib "sendmail.ss" "net"))
|
||||||
(post:
|
(post:
|
||||||
|
(define info
|
||||||
|
(format "hw.scm: ~a ~a"
|
||||||
|
(file-size "hw.scm")
|
||||||
|
(file-or-directory-modify-seconds "hw.scm")))
|
||||||
|
(LOG "Sending a receipt: ~a" info)
|
||||||
(send-mail-message
|
(send-mail-message
|
||||||
"cour-staff@university.edu
|
"course-staff@university.edu
|
||||||
"Submission Receipt"
|
"Submission Receipt"
|
||||||
(map (lambda (user) (user-substs user "{Full Name} <{Email}>"))
|
(map (lambda (user) (user-substs user "{Full Name} <{Email}>"))
|
||||||
users)
|
users)
|
||||||
(list (user-substs (first users) "{TA Name} <{TA Email}>"))
|
(list (user-substs (first users) "{TA Name} <{TA Email}>"))
|
||||||
null
|
null
|
||||||
(list "Your submission was received"
|
`("Your submission was received" ,info))
|
||||||
... provide details on hw.scm ...))
|
|
||||||
(message (string-append
|
(message (string-append
|
||||||
"Your submission was successfully saved."
|
"Your submission was successfully saved."
|
||||||
" You will get an email receipt within 30 minutes;"
|
" You will get an email receipt within 30 minutes;"
|
||||||
" if not, please contact the course staff.")
|
" if not, please contact the course staff.")
|
||||||
'(ok)))
|
'(ok)))
|
||||||
|
|
||||||
|
|
||||||
> (pairs-or-singles-with-warning users)
|
> (pairs-or-singles-with-warning users)
|
||||||
This procedure is intended for use as the :users entry in a checker.
|
This procedure is intended for use as the :users entry in a checker.
|
||||||
It will do nothing if there are two users, and throw an error if
|
It will do nothing if there are two users, and throw an error if
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
[(pair? default) (car default)]
|
[(pair? default) (car default)]
|
||||||
[else (error (alist-name alist) "no value for `~s'" key)]))
|
[else (error (alist-name alist) "no value for `~s'" key)]))
|
||||||
|
|
||||||
|
(provide LOG)
|
||||||
(define (LOG str . args)
|
(define (LOG str . args)
|
||||||
;; Assemble log into into a single string, to make
|
;; Assemble log into into a single string, to make
|
||||||
;; interleaved log lines unlikely:
|
;; interleaved log lines unlikely:
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
(prefix pc: (lib "pconvert.ss"))
|
(prefix pc: (lib "pconvert.ss"))
|
||||||
(lib "pretty.ss")
|
(lib "pretty.ss")
|
||||||
(lib "list.ss")
|
(lib "list.ss")
|
||||||
(lib "string.ss"))
|
(lib "string.ss")
|
||||||
|
(only "handin-server.ss" LOG))
|
||||||
|
|
||||||
(provide unpack-submission
|
(provide unpack-submission
|
||||||
|
|
||||||
|
@ -31,7 +32,9 @@
|
||||||
check-defined
|
check-defined
|
||||||
look-for-tests
|
look-for-tests
|
||||||
user-construct
|
user-construct
|
||||||
test-history-enabled)
|
test-history-enabled
|
||||||
|
|
||||||
|
LOG)
|
||||||
|
|
||||||
(define (unpack-submission str)
|
(define (unpack-submission str)
|
||||||
(let* ([base (make-object editor-stream-in-bytes-base% str)]
|
(let* ([base (make-object editor-stream-in-bytes-base% str)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user