diff options
Diffstat (limited to 'src/private/autojudging.php')
| -rwxr-xr-x | src/private/autojudging.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/private/autojudging.php b/src/private/autojudging.php index bda7d38..cbdc1ec 100755 --- a/src/private/autojudging.php +++ b/src/private/autojudging.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// Last modified 10/sep/2015 by cassio@ime.usp.br +// Last modified 19/Oct/2015 by cassio@ime.usp.br $ds = DIRECTORY_SEPARATOR; if($ds=="") $ds = "/"; @@ -387,7 +387,7 @@ if($retval != 0) { DBGiveUpRunAutojudging($contest, $site, $number, $ip, "warning: problem package has no input files"); continue; } else { - $errp=0; + $errp=0; $ncor=0; foreach($inputlist as $file) { $file = basename($file); if(is_file($dir . $ds . "input" . $ds . $file)) { @@ -456,7 +456,6 @@ if($retval != 0) { $answer = "(WHILE RUNNING) " . $answer; break; } - $ncor = 0; if(is_file($dir . $ds . 'output' . $ds . $file)) { @unlink($dir . $ds . 'compout'); $ex = escapeshellcmd($scriptcomp) ." ". @@ -597,7 +596,7 @@ if($retval != 0) { } if($retval >= 7 && $retval <= 9) { $ans = file("allout"); - $anstmp = trim(escape_string($ans[count($ans)-1])); + $anstmp = substr(trim(escape_string($ans[count($ans)-1])),0,100); unset($ans); $answer = "(probably runtime error - unusual code: $retval) " . $anstmp; // runtime error @@ -605,7 +604,7 @@ if($retval >= 7 && $retval <= 9) { } if($retval == 0 || $retval > 9) { $ans = file("allout"); - $anstmp = trim(escape_string($ans[count($ans)-1])); + $anstmp = substr(trim(escape_string($ans[count($ans)-1])),0,100); unset($ans); LogLevel("Autojudging: Script returned unusual code: $retval ($anstmp)". "(run=$number, site=$site, contest=$contest)",1); @@ -619,6 +618,7 @@ if($retval == 0 || $retval > 9) { echo "Sending results to server...\n"; //echo "out==> "; system("tail -n1 ". $dir.$ds.'allout'); //echo "err==> "; system("tail -n1 ". $dir.$ds.'allerr'); +$answer=substr($answer,0,200); DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $dir.$ds.'allout', $dir.$ds.'allerr', $retval); LogLevel("Autojudging: answered '$answer' (run=$number, site=$site, contest=$contest)",3); echo "Autojudging answered '$answer' (contest=$contest, site=$site, run=$number)\n"; |