From 198dcd42b9a44a838020c05999dfb263ae1628e8 Mon Sep 17 00:00:00 2001 From: cassio Date: Sun, 30 Aug 2015 16:17:40 +0100 Subject: small fixes --- src/team/run.php | 23 +++++++++++++++++++++++ tools/boca-submit-run | 4 ++++ tools/boca-submit-run-aux | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/team/run.php b/src/team/run.php index db142f4..9641386 100644 --- a/src/team/run.php +++ b/src/team/run.php @@ -33,6 +33,29 @@ if (isset($_FILES["sourcefile"]) && isset($_POST["problem"]) && isset($_POST["Su $prob = myhtmlspecialchars($_POST["problem"]); $lang = myhtmlspecialchars($_POST["language"]); + $probs = DBGetProblems($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usertype"]=='judge'); + $i = 0; + $ss = ""; + for (;$i= count($probs)) { + echo "RESULT: INVALID PROBLEM (options are: " . $ss . ")"; + exit; + } + $langs = DBGetLanguages($_SESSION["usertable"]["contestnumber"]); + $i = 0; + $ss = ""; + for (;$i= count($langs)) { + echo "RESULT: INVALID LANGUAGE (options are: " . $ss . ")"; + exit; + } + $type=myhtmlspecialchars($_FILES["sourcefile"]["type"]); $size=myhtmlspecialchars($_FILES["sourcefile"]["size"]); $name=myhtmlspecialchars($_FILES["sourcefile"]["name"]); diff --git a/tools/boca-submit-run b/tools/boca-submit-run index 0b42e9f..f78fbd6 100755 --- a/tools/boca-submit-run +++ b/tools/boca-submit-run @@ -33,6 +33,10 @@ if [ "$1" == "" ]; then echo "PASSWORD is your password" echo "FILE is your submission file" echo "PROBLEM and LANGUAGE are according to defined in BOCA" + echo "==>>You can check at your BOCA interface to be sure<<==" + echo "PROBLEM is usually a single letter e.g. A or B or C etc" + echo "LANGUAGE is usually one of { c cpp cc java }" + echo "==>>You can check at your BOCA interface to be sure<<==" exit 1 fi diff --git a/tools/boca-submit-run-aux b/tools/boca-submit-run-aux index 1469af3..a9ff432 100755 --- a/tools/boca-submit-run-aux +++ b/tools/boca-submit-run-aux @@ -46,7 +46,7 @@ if [ "$?" == "0" ]; then echo -n "&data=" >> $temp uuencode -m zzzzzzzzzz < $1 | grep -v "begin-base64.*zzzzzzzzzz" | perl -MURI::Escape -lne 'print uri_escape($_)' >> $temp - wget -t 2 -T 7 "http://$BOCASERVER/boca/team/getfile.php" --load-cookies /tmp/.cookie.txt --keep-session-cookies -O /dev/null --post-file=$temp >${temp}.out 2>/dev/null + wget -t 2 -T 7 "http://$BOCASERVER/boca/team/run.php" --load-cookies /tmp/.cookie.txt --keep-session-cookies -O /dev/null --post-file=$temp >${temp}.out 2>/dev/null res=`tail -n1 ${temp}.out` echo $res | grep -q "RESULT:" @@ -54,7 +54,7 @@ if [ "$?" == "0" ]; then echo "$BOCASERVER : run $uniq dateerr $dateerr : $res" rm -f "$1" else - echo "$BOCASERVER : run $uniq dateerr $dateerr : error to submit run (getfile.php), will try again" + echo "$BOCASERVER : run $uniq dateerr $dateerr : error to upload the run, will NOT try again, check details" fi rm -f ${temp}.out fi -- cgit v1.2.3