diff options
| author | cassiopc <cassiopc@gmail.com> | 2015-09-25 09:50:00 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2015-09-25 09:50:00 +0000 |
| commit | 09134766cd1ce6d19fc77807bd52a899dde2eb05 (patch) | |
| tree | 1d3ab9c362bea1c6fb2c38241e5a5e9d9a5135b9 /src | |
| parent | af0e5ce80abb5ebb92672541d9c9603f92e80292 (diff) | |
| download | boca-09134766cd1ce6d19fc77807bd52a899dde2eb05.tar.gz boca-09134766cd1ce6d19fc77807bd52a899dde2eb05.zip | |
minor fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/frun.php | 4 | ||||
| -rw-r--r-- | src/judge/team.php | 4 | ||||
| -rwxr-xr-x | src/private/autojudging.php | 23 | ||||
| -rw-r--r-- | src/team/run.php | 6 |
4 files changed, 27 insertions, 10 deletions
diff --git a/src/frun.php b/src/frun.php index bdd1a02..5c5c2ec 100644 --- a/src/frun.php +++ b/src/frun.php @@ -487,7 +487,7 @@ function DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $stdout, return true; } - echo "DEBUG: $contest, $site, " .$a["usernumber"].", $site, $number, $retval\n"; + //echo "DEBUG: $contest, $site, " .$a["usernumber"].", $site, $number, $retval\n"; if(DBUpdateRunO($contest, $site, $a["usernumber"], $site, $number, $retval, $c)==false) { DBExec($c, "rollback work", "DBUpdateRunAutoJudging(rollback)"); LOGError("Unable to automatically update a run answer (run=$number, site=$site, ". @@ -868,7 +868,7 @@ function DBUserRuns($contest,$site,$user) { "r.runfilename as filename, r.rundata as oid, " . "p.problemcolorname as colorname, p.problemcolor as color, a.yes as yes, " . "p.problemname as problem, r.runstatus as status, l.langname as language, l.langextension as extension, " . - "a.runanswer as answer, a.fake as ansfake, r.rundatediffans as anstime, " . + "a.runanswer as answer, a.fake as ansfake, r.rundatediffans as anstime, r.autoanswer as autoanswer, " . "r.runanswer1 as answer1, r.runanswer2 as answer2 " . "from runtable as r, problemtable as p, answertable as a, langtable as l " . "where r.contestnumber=$contest and p.contestnumber=r.contestnumber and " . diff --git a/src/judge/team.php b/src/judge/team.php index 11d03ad..76e21bb 100644 --- a/src/judge/team.php +++ b/src/judge/team.php @@ -109,6 +109,10 @@ if($redo) { } else { $strtmp .= " <td>" . $run[$i]["answer"]; + if(false) { + if(strpos($run[$i]["autoanswer"],"OKs") > 0) + $strtmp .= ' ' . substr($run[$i]["autoanswer"],strrpos($run[$i]["autoanswer"],'(')); + } if($run[$i]['yes']=='t') { $strtmp .= " <img alt=\"".$run[$i]["colorname"]."\" width=\"15\" ". "src=\"" . balloonurl($run[$i]["color"]) ."\" />"; diff --git a/src/private/autojudging.php b/src/private/autojudging.php index d4f9719..bda7d38 100755 --- a/src/private/autojudging.php +++ b/src/private/autojudging.php @@ -456,7 +456,7 @@ 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) ." ". @@ -485,26 +485,27 @@ if($retval != 0) { if($localretval < 4 || $localretval > 6) { // contact staff $retval = 7; - $answer='(Contact staff)' . $answertmp; + $answer='(Contact staff)' . $answertmp . ' (' . $ncor . '/' . $ninputlist . ' OKs)'; break; } if($localretval == 6) { $retval=$localretval; - $answer='(Wrong answer)'. $answertmp; + $answer='(Wrong answer)'. $answertmp . ' (' . $ncor . '/' . $ninputlist . ' OKs)'; break; } if($localretval == 5) { $retval=$localretval; - $answer='(Presentation error)'. $answertmp; + $answer='(Presentation error)'. $answertmp . ' (' . $ncor . '/' . $ninputlist . ' OKs)'; } else { if($localretval != 4) { $retval = 7; - $answer='(Contact staff)' . $answertmp; + $answer='(Contact staff)' . $answertmp . ' (' . $ncor . '/' . $ninputlist . ' OKs)'; break; } - if($retval == 0) { + $ncor++; + if($retval == 0 || $retval == 1) { // YES! - $answer='(YES)' . $answertmp; + $answer='(YES)' . $answertmp . ' (' . $ncor . '/' . $ninputlist . ' OKs)'; $retval = 1; } } @@ -594,6 +595,14 @@ if($retval != 0) { } */ } +if($retval >= 7 && $retval <= 9) { + $ans = file("allout"); + $anstmp = trim(escape_string($ans[count($ans)-1])); + unset($ans); + $answer = "(probably runtime error - unusual code: $retval) " . $anstmp; + // runtime error + $retval = 3; +} if($retval == 0 || $retval > 9) { $ans = file("allout"); $anstmp = trim(escape_string($ans[count($ans)-1])); diff --git a/src/team/run.php b/src/team/run.php index 6313c2f..b14d387 100644 --- a/src/team/run.php +++ b/src/team/run.php @@ -232,7 +232,11 @@ if($redo) { $strtmp .= " <td>Not answered yet"; } else { - $strtmp .= " <td>" . $run[$i]["answer"]; + $strtmp .= " <td>" . $run[$i]["answer"]; + if(false) { + if(strpos($run[$i]["autoanswer"],"OKs") > 0) + $strtmp .= ' ' . substr($run[$i]["autoanswer"],strrpos($run[$i]["autoanswer"],'(')); + } if($run[$i]['yes']=='t') { $strtmp .= " <img alt=\"".$run[$i]["colorname"]."\" width=\"15\" ". "src=\"" . balloonurl($run[$i]["color"]) ."\" />"; |