1 # The Evaluator -- Public Submit Script
2 # (c) 2001 Martin Mares <mj@ucw.cz>
5 [ -n "$MO_PUBLIC" -a -d "$MO_PUBLIC" ] || { echo >&2 "MO_PUBLIC not set, giving up." ; exit 1 ; }
10 if [ "$1" = --force ] ; then
14 [ -n "$1" -o "$1" = "--help" ] || die "Usage: submit [--force] <problem> [<test>]"
20 if [ -n "$OPEN_DATA_PROBLEM" ] ; then
21 [ -n "$2" ] || die "You need to specify test number for open data problems."
24 syntax-check || FAILED=1
26 [ -z "$2" ] || die "No test number should be specified for normal problems."
29 for TEST in $SAMPLE_TESTS ; do
30 pstart "Checking on sample input $TEST: "
31 if test-run && syntax-check && output-check ; then
38 pstart "Submitting... "
39 if [ $FAILED != 0 ] ; then
40 if [ $FORCE != 0 ] ; then
41 pcont "(tests failed, but --force given) "
43 pend "TESTS FAILED Use submit --force if you really want to submit a wrong solution."
48 [ -z "$OPEN_DATA_PROBLEM" ] && rm -rf ~/.submit/$PROBLEM
49 mkdir -p ~/.submit/$PROBLEM
50 cp $SRCN ~/.submit/$PROBLEM/