So, I've been playing around with the handin server these days.

My purposes of the handin require students to submit images using the htdp 
image and universe libraries.

First, I would like to note that for the images, you must turn off 
textualization/create-text in your checker:

(check:
   ; Get timestamp of the submission and add it to header and report
   :language 'racket
   :requires '(bsl-plus-image)                                                  
   
   :create-text? #f
   :textualize? #f

My issues follow:

1) Initially, there is a conflict with one of the image functions and another 
function provided by the language. I fixed this by adding the package as 
suggested in the other thread. We're still waiting to see if the checker 
sandbox has updated in order to see if there's been an update. (see here for 
more detail: https://groups.google.com/forum/#!topic/racket-users/twViz38AL7M)

2) Afterwards, there is a permission denied error:
[2|2016-10-06T09:49:28] ERROR: Error in your code --
[2|2016-10-06T09:49:28] file-exists?: `exists' access denied for libobj.dylib

This can be solved using this hacky solution in this thread:
https://groups.google.com/forum/?fromgroups#!searchin/racket-users/libobj%7Csort:relevance/racket-users/W_-4aN7kPyI/cwgwz2xIBAAJ

As of now, I expose my path. I'm not sure how to create a better solution than 
the one mentioned stating to add the following lines at the top of your 
checker.rkt
(module checker handin-server/checker
  (require handin-server/grading-utils)

  (require handin-server/sandbox)
  (sandbox-path-permissions
   (cons
    (list 'read "/")
    (sandbox-path-permissions)))

3) Finally, I found a very serious issue in the collection's handin server 
code. students are not able to submit because of the server was trying to write 
to a grading/text.rkt even though I specified not to! I've traced the issue to 
the collection's handin server.

>From (collection-path "handin-server"), 

/Library/Racket/6.6/pkgs/handin/handin-server/checker.rkt:

Starting around line 467 the below code is the culprit!
Essentially, at the bottom of the below segment, regardless if you checked if 
you were creating a text file in your checker.rkt, it will attempt to write the 
text with the below code:
 (when (thread-cell-ref added-lines) (write-text))

Essentially, to fix this issue, you may replace it with
 (when (and (thread-cell-ref added-lines) create-text?) (write-text))

;; ========================================
                 ;; convert to text, evaluate, check
                 (define (check users submission)
                   (define text-file (format "grading/text.~a" suffix))
                   (define (prefix-line str)
                     (printf "~a~a\n" markup-prefix str))
                   (define generic-substs `(("submission" . ,submission-dir)))
                   (define (prefix-line/substs str)
                     (prefix-line (subst str generic-substs)))
                   (define (write-text)
                     (set-run-status "creating text file")
                     (with-output-to-file text-file #:exists 'truncate
                       (lambda ()
                         (for ([user (in-list users)])
                           (prefix-line (user-substs user student-line)))
                         (for-each prefix-line/substs extra-lines)
                         (for-each prefix-line/substs
                                   (cond [(thread-cell-ref added-lines)
                                          => unbox]
                                         [else '()]))
                         (display submission-text))))
                   (define submission-text
                     (and create-text?
                          (begin (set-run-status "reading submission")
                                 ((if multi-file
                                    (unpack-multifile-submission
                                     names-checker output-file)
                                    submission->bytes)
                                  submission maxwidth textualize? untabify?
                                  markup-prefix prefix-re))))
                   (define (uem-handler e)
                     (let ([m (if (exn? e) (exn-message e) (format "~a" e))])
                       (cond
                         [(procedure? uem) (uem m)]
                         [(not (string? uem))
                          (error* "badly configured user-error-message")]
                         [(regexp-match? #rx"~[aesvAESV]" uem) (error* uem m)]
                         [else (error* "~a" uem)])))
                   (when create-text? (make-directory "grading") (write-text))
                   (when value-printer (current-value-printer value-printer))
                   (when coverage? (sandbox-coverage-enabled #t))
                   (set-run-status "checking submission")
                   (cond
                     [(not eval?) (let () body ...)]
                     [language
                      (let ([eval (with-handlers ([void uem-handler])
                                    (parameterize ([sandbox-run-submodules 
'(test)])
                                      (call-with-evaluator/submission
                                       language (append requires teachpacks)
                                       submission values)))])
                        (set-run-status "running tests")
                        (parameterize ([submission-eval (wrap-evaluator eval)])
                          (let-syntax ([with-submission-bindings
                                        (syntax-rules ()
                                          [(_ bindings body*1 body* (... ...))
                                           (with-bindings eval bindings
                                             body*1 body* (... ...))])])
                            (let () body ...))
                          ;; will do nothing when called a second time
                          (when coverage? (!all-covered))
                           (when (thread-cell-ref added-lines) (write-text))))
                          (when (and (thread-cell-ref added-lines) 
create-text?) (write-text))))]
                     [else (error* "no language configured for submissions")])
                   output-file) 


-------------------
I just wanted to summarize the current issues with the handin server and 
summarized my solutions that I came up with. If anyone wants to comment, or 
provide alternatives, feel free to chat.
-Matt 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to