From 4a96669616d1600604abfa21da5b410432e5b0a4 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Sat, 12 Aug 2017 15:58:37 +0100 Subject: suggest java class name, better output --- doc/problemexamples/problemtemplate/run/java | 8 +++++++- src/team/run.php | 2 +- tools/control-machines.sh | 9 +++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/problemexamples/problemtemplate/run/java b/doc/problemexamples/problemtemplate/run/java index ff7a368..4cec4ee 100755 --- a/doc/problemexamples/problemtemplate/run/java +++ b/doc/problemexamples/problemtemplate/run/java @@ -178,7 +178,13 @@ else ret=$? fi if [ $ret -gt 10 ]; then - echo "> > > > > > > Nonzero return code - possible runtime error - I'M GUESSING IT IS RUNTIME ERROR < < < < < < < <" + if [ -r stderr0 ]; then + grep -q "not find or load main class" stderr0 + if [ $? == 0 ]; then + echo "> > > Nonzero return code - possible class name mismatch - do check < < <" + else + echo "> > > Nonzero return code - possible runtime error - do check < < <" + fi ret=9 fi if [ -f stdout0 ]; then diff --git a/src/team/run.php b/src/team/run.php index 012030a..471e262 100644 --- a/src/team/run.php +++ b/src/team/run.php @@ -159,7 +159,7 @@ $pastabs=''; if(isset($_POST["pastabs"])) $pastabs=myhtmlspecialchars($_POST["pa //@file_put_contents($fcname . ".try", $verify1 . "\n", FILE_APPEND | LOCK_EX); $codes = @file($fcname . ".txt",FILE_IGNORE_NEW_LINES); if(is_array($codes) && in_array($verify,$codes)) { -@file_put_contents($fcname . ".try", $verify1 . "-ALREADY\n", FILE_APPEND | LOCK_EX); + @file_put_contents($fcname . ".try", $verify1 . "-ALREADY\n", FILE_APPEND | LOCK_EX); if(isset($_POST['name']) && $_POST['name'] != '') { echo "\nRESULT: SAME FILE ALREADY SUBMITTED FOR THIS PROB/LANG"; exit; diff --git a/tools/control-machines.sh b/tools/control-machines.sh index 692e47c..34620a8 100644 --- a/tools/control-machines.sh +++ b/tools/control-machines.sh @@ -29,10 +29,15 @@ else else for i in `ls runs-submitted*.txt`; do cat $i|cut -d'-' -f1 |sort -u| while read lin; do - q=`grep -c $lin runs-submitted*.txt | wc -l` + q=`grep -c $lin runs-submitted*.txt | grep -v ":0$" | wc -l` if [ "$q" != "1" ]; then echo "===Computer $lin used by multiple users" - grep -c $lin runs-submitted*.txt + grep -c $lin runs-submitted*.txt | grep -v ":0$" | while read line1; do + fname=`echo $line1 | cut -d':' -f1` + fname=`basename $fname .txt` + echo $fname + grep $lin ${fname}.try | cut -d'-' -f4 | while read line2; do date -d "@$line2"; done + done fi done done -- cgit v1.2.3