diff options
| author | cassio <cassiopc@gmail.com> | 2015-08-30 15:17:40 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2015-08-30 15:17:40 +0000 |
| commit | 198dcd42b9a44a838020c05999dfb263ae1628e8 (patch) | |
| tree | 0d878d74764882fe7bb6592d543954b29622d2f3 | |
| parent | be2798607fd15e8b116993a8d33d75b0a6ad0f50 (diff) | |
| download | boca-198dcd42b9a44a838020c05999dfb263ae1628e8.tar.gz boca-198dcd42b9a44a838020c05999dfb263ae1628e8.zip | |
small fixes
| -rw-r--r-- | src/team/run.php | 23 | ||||
| -rwxr-xr-x | tools/boca-submit-run | 4 | ||||
| -rwxr-xr-x | 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);$i++) { + if($probs[$i]["problem"]==$prob) break; + $ss .= $probs[$i]["problem"] . " "; + } + if($i >= count($probs)) { + echo "RESULT: INVALID PROBLEM (options are: " . $ss . ")"; + exit; + } + $langs = DBGetLanguages($_SESSION["usertable"]["contestnumber"]); + $i = 0; + $ss = ""; + for (;$i<count($langs);$i++) { + if($langs[$i]["name"]==$lang) break; + $ss .= $langs[$i]["name"] . " "; + } + if($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 |