diff --git a/collects/handin-server/overridden-collects/fake-teachpack/htdp/guess.ss b/collects/handin-server/overridden-collects/fake-teachpack/htdp/guess.ss new file mode 100644 index 0000000000..757c4a8144 --- /dev/null +++ b/collects/handin-server/overridden-collects/fake-teachpack/htdp/guess.ss @@ -0,0 +1,31 @@ +#lang scheme/gui + +(require htdp/error lang/prim) + +(provide guess-with-gui guess-with-gui-3 guess-with-gui-list) + +(define-higher-order-primitive guess-with-gui guess-with-gui/proc + (check-guess)) +(define-higher-order-primitive guess-with-gui-3 guess-with-gui-3/proc + (check-guess)) +(define-higher-order-primitive guess-with-gui-list guess-with-gui-list/proc + (_ check-guess-list)) + +(define (convert guesses:vec) + (void)) + +(define (guess-with-gui/proc cg) + (check-proc 'guess-with-gui cg 2 'first "two arguments") + (void)) + +(define (guess-with-gui-3/proc cg) + (check-proc 'guess-with-gui-3 cg (+ 3 1) 'first "four arguments") + (void)) + +(define (guess-with-gui-list/proc n cg) + (check-arg 'guess-with-gui-list + (and (number? n) (integer? n) (>= n 1)) "positive integer" '1st n) + (check-proc 'guess-with-gui-list cg 2 'first "two arguments") + (unless (<= (expt 10 n) 2147483647) + (error 'guess-with-gui-list "the given number of digits (~a) is too large" n)) + (void)) diff --git a/collects/handin-server/overridden-collects/readme.txt b/collects/handin-server/overridden-collects/readme.txt index a73c86303f..5f502b1aab 100644 --- a/collects/handin-server/overridden-collects/readme.txt +++ b/collects/handin-server/overridden-collects/readme.txt @@ -4,3 +4,11 @@ that appear here will be used instead of ones in the PLT tree or the user-local collections. Use it to override collections that are safe for testing, for example -- avoid using actual gui. See also the documentation for `sandbox-override-collection-paths' in "doc.txt". + +This is currently used with the `teachpack' collection. Note that +mzscheme resolved collection directories based on toplevel names only, +which means that if we actually use `teachpack' for the directory +name, then files that are not here will not be searched in the usual +plt tree. Because of this the collection is called `fake-teachpack', +and checkers should specify requires in this collection if submissions +need a fake teachpack.