2 # The Evaluator -- Public Submit Script
3 # (c) 2001--2004 Martin Mares <mj@ucw.cz>
6 [ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; }
11 if [ "$1" = --force ] ; then
15 [ -n "$1" -o "$1" = "--help" ] || die "Usage: submit [--force] <problem> [<test-number>]"
24 [ $1 == 0 ] && exit 1 || exit 0
28 if [ $TASK_TYPE == open-data ] ; then
29 [ -n "$PART" ] || die "You need to specify test number for open data problems."
31 pstart "Test case $TEST: "
34 ln $SRCN $TDIR/$TEST.out
39 [ -z "$PART" ] || die "Test number should be given only for open data problems."
42 for TEST in $SAMPLE_TESTS ; do
44 pstart "Checking on sample input $TEST: "
48 die "How could I get there? It's a buuuuug!"
49 ) || FAILED=$(($FAILED+1))
53 if [ $FAILED != 0 ] ; then
54 if [ $FORCE != 0 ] ; then
55 pend "TESTS FAILED, but --force given, so submitting anyway."
57 pend "TESTS FAILED. Nothing has been submitted!"
58 pend "Use submit --force if you really want to submit an obviously WRONG solution."
63 if [ -n "$REMOTE_SUBMIT" ] ; then
64 pstart "Submitting to the server... "
65 $MO_ROOT/bin/remote-submit $PROBLEM $PART $SRCN
70 pstart "Submitting... "
72 if [ $TASK_TYPE == open-data ] ; then
73 mkdir -p ~/.submit/$PROBLEM
74 cp $SRCN ~/.submit/$PROBLEM/$PART.out
76 rm -rf ~/.submit/$PROBLEM
77 mkdir -p ~/.submit/$PROBLEM
78 cp $SRCN ~/.submit/$PROBLEM/