Has there been any update on this if it was added to the sandbox? Or should I still try to package it?
I'm having a similar problem where I'm trying to submit images and the students are requiring: (require 2htdp/image) (require 2htdp/universe) In my checker, I have the following: (check: ; Get timestamp of the submission and add it to header and report :language '(special intermediate) ;:requires '((except-in lang/htdp-beginner image? image=?) ) :create-text? #f and the students will get this message when submitting: submit error: Error in your code -- #(struct:object:text% ...):7:9: module: identifier already imported from: (lib "htdp-intermediate.rkt" ... at: image? in: 2htdp/image Thoughts? On Thursday, February 12, 2015 at 10:56:56 AM UTC-5, Matthew Flatt wrote: > One solution is to create a module that exports only the things you > want, so that you can provide a module path that effectively implements > a more general `require` spec. Then, to avoid path problems, it will be > easiest to install that module as a package. > > > Specifically, create a directory and file > > bsl-plus-image/main.rkt > > with the "main.rkt" content > > #lang racket/base > (require 2htdp/image > (except-in lang/htdp-beginner image? image=?)) > (provide (all-from-out 2htdp/image > lang/htdp-beginner)) > > Then, install the "bsl-plus-image" directory as a package for the > Racket installation that runs the handin server. You can do that with > the command line > > raco pkg install -i path/to/basl-plus-image > > or you can leave out the `-i` if running `raco` as the same user as the > handin server process. You can also use the DrRacket "Install > Package..." menu item if that turns out to be more convenient, but keep > in mind that this is on the handin server side, not clients. > > After installing the directory as a package, you can use > > (check: :language 'racket > :requires '(bsl-plus-image > test-engine/racket-tests) > ....) > > Longer term, I think that the `racket/sandbox` as used by `check:` > should allow require specs, instead of just module paths. > > At Tue, 10 Feb 2015 23:42:51 -0500, Suzanne Menzel wrote: > > Hello, > > > > I’m having trouble getting the handin server to accept a BSL file that uses > > the image library and also includes template definitions. I can make it > > work > > separately. That is, I can accept BSL image program files as long as they > > don’t have any templates and I can accept BSL programs with templates as > > long > > as they don’t use images. > > > > The problem is that when I go to require both 2htdp/image and > > lang/htdp-beginner in the checker, there is a conflict with the image? > > procedure being defined in both modules. Trying to use (except-in > > 2htdp/image > > image?) inside the requires list doesn’t work. > > > > What do I need to do to write a checker that will accept the student file > > shown below? > > > > My broken checker is included below. (The student file will also have > > check-expects, which explains the presence of test-engine/racket-tests.) > > > > Suzanne > > > > ––––––-––––––-––––––-––––––-––––––- > > > > ;; broken checker! > > #lang s-exp handin-server/checker > > (require handin-server/grading-utils) > > (pre: (check-deadline)) > > (check: :language 'racket > > :requires '(2htdp/image ;;; (except-in 2htdp/image > > image?) > > test-engine/racket-tests > > lang/htdp-beginner) > > :create-text? #t > > :textualize? #f > > ) > > (post: #f) > > > > > > ;; Student file to be submitted > > (require 2htdp/image) > > ;; template: > > (define (process-strings strings) > > (cond > > [(empty? strings) ...] > > [else (... (first strings) ... > > (process-strings (rest strings)))])) > > ;; function based on template: > > (define (make-color-chart colors) > > (cond > > [(empty? colors) empty-image] > > [else (beside > > (rectangle 30 100 "solid" (first colors)) > > (make-color-chart (rest colors)))])) > > (check-expect (image-width (make-color-chart empty)) 0) > > > > ____________________ > > Racket Users list: > > http://lists.racket-lang.org/users > > ____________________ > Racket Users list: > http://lists.racket-lang.org/users -- 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.