diff options
| author | Cassio de Campos <cassiopc@gmail.com> | 2017-08-12 17:46:04 +0000 |
|---|---|---|
| committer | Cassio de Campos <cassiopc@gmail.com> | 2017-08-12 17:46:04 +0000 |
| commit | 1a7aa506cf7c239890fab96fd024640b1b712eb8 (patch) | |
| tree | 67376e7230b180cab9d8f8cc986cd56ffb09589e /src/private/autojudging.php | |
| parent | 4a96669616d1600604abfa21da5b410432e5b0a4 (diff) | |
| download | boca-1a7aa506cf7c239890fab96fd024640b1b712eb8.tar.gz boca-1a7aa506cf7c239890fab96fd024640b1b712eb8.zip | |
scripts for logging root activity and bug fix of autojudge
Diffstat (limited to 'src/private/autojudging.php')
| -rwxr-xr-x | src/private/autojudging.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/private/autojudging.php b/src/private/autojudging.php index 5bd45cc..c5b5556 100755 --- a/src/private/autojudging.php +++ b/src/private/autojudging.php @@ -461,7 +461,7 @@ if($retval != 0) { $ex = escapeshellcmd($scriptcomp) ." ". escapeshellarg($dir . $ds . "team" . $ds . $file)." ". escapeshellarg($dir . $ds . "output" . $ds . $file)." ". - escapeshellarg($dir . $ds . "input" . $ds . $file) . " >compout"; + escapeshellarg($dir . $ds . "input" . $ds . $file) . " >compout 2>&1"; echo "Executing " . $ex . " at " . getcwd() . " for output file $file\n"; if(system($ex, $localretval)===false) $localretval = -1; @@ -474,7 +474,9 @@ if($retval != 0) { fwrite($fp, $dif[$difi]); if($difi >= 5000) fwrite($fp, "===OUTPUT OF COMPARING SCRIPT TOO LONG - TRUNCATED===\n"); else fwrite($fp, "===OUTPUT OF COMPARING SCRIPT ENDS HERE===\n"); - $answertmp = trim($dif[count($dif)-1]); + $answertmp = ''; + if(count($dif) > 0) + $answertmp = substr(trim($dif[count($dif)-1]),0,200); fclose($fp); foreach (glob($dir . $ds . '*') as $fne) { @chown($fne,"nobody"); |