aboutsummaryrefslogtreecommitdiff
path: root/src/private/autojudging.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-10-16 21:34:48 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-10-16 21:34:48 +0000
commitd8f2907fb00b701f91e6e98d33c4e6c0dd0619a5 (patch)
tree2a8d0520e8f538d1cb31931b37c23ab095885890 /src/private/autojudging.php
parent1bfadfa27cb0b94d2063054ccf78f8bfedd62f59 (diff)
downloadboca-d8f2907fb00b701f91e6e98d33c4e6c0dd0619a5.tar.gz
boca-d8f2907fb00b701f91e6e98d33c4e6c0dd0619a5.zip
bug fixes
Diffstat (limited to 'src/private/autojudging.php')
-rwxr-xr-xsrc/private/autojudging.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/private/autojudging.php b/src/private/autojudging.php
index dcb7398..2a8b1ed 100755
--- a/src/private/autojudging.php
+++ b/src/private/autojudging.php
@@ -44,7 +44,7 @@ if(system('test "`id -u`" -eq "0"',$retval)===false || $retval!=0) {
exit;
}
-ini_set('memory_limit','600M');
+ini_set('memory_limit','1200M');
ini_set('output_buffering','off');
ini_set('implicit_flush','on');
@ob_end_flush();
@@ -487,10 +487,14 @@ while(42) {
$answertmp = substr(trim($dif[count($dif)-1]),0,200);
$answertmp = sanitizeText($answertmp);
fclose($fp);
+ /*
foreach (glob($dir . $ds . '*') as $fne) {
- @chown($fne,"nobody");
- @chmod($fne,0755);
+ if(is_file($fne)) {
+ @chown($fne,"nobody");
+ @chmod($fne,0755);
+ }
}
+ */
// retval 5 (presentation) and retval 6 (wronganswer) are already compatible with the compare script
if($localretval < 4 || $localretval > 6) {
// contact staff
@@ -616,9 +620,14 @@ while(42) {
if(count($ans) > 0)
$anstmp = substr(trim(escape_string($ans[count($ans)-1])),0,100);
unset($ans);
- $answer = "(probably runtime error - unusual code: $retval) " . $anstmp;
- // runtime error
- $retval = 3;
+ if(strpos(file_get_contents('allerr'),'Error: Could not find or load main class') === false) {
+ $answer = "(probably runtime error - unusual code: $retval) " . $anstmp;
+ // runtime error
+ $retval = 3;
+ } else {
+ $answer = "(probably wrong name of class - unusual code: $retval) "; // . $anstmp;
+ $retval = 8;
+ }
}
if($retval == 0 || $retval > 9) {
$ans = file("allout");
@@ -638,7 +647,7 @@ while(42) {
//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";
+ LogLevel("Autojudging: answered $retval '$answer' (run=$number, site=$site, contest=$contest)",3);
+ echo "Autojudging answered $retval '$answer' (contest=$contest, site=$site, run=$number)\n";
}
?>