aboutsummaryrefslogtreecommitdiff
path: root/src/frun.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/frun.php')
-rw-r--r--src/frun.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/frun.php b/src/frun.php
index 359b395..eb5d33f 100644
--- a/src/frun.php
+++ b/src/frun.php
@@ -481,7 +481,7 @@ function DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $stdout,
$b = DBSiteInfo($contest, $site, $c);
- if($b["siteautojudge"]!="t") {
+ if($b["siteautojudge"]!="t") { // && $retval != 1 && $retval != 6) { //cassiopc incluir automatic judging of some codes 1:YES WA:6
DBExec($c, "commit work", "DBUpdateRunAutojudging(commit)");
LOGLevel("Autojudging answered a run (run=$number, site=$site, contest=$contest, answer='$answer', retval=$retval)", 3);
return true;
@@ -512,6 +512,17 @@ function DBGiveUpRunAutojudging($contest, $site, $number, $ip="", $ans="") {
}
$a = DBRow($r,0);
$t = time();
+
+ $b = DBSiteInfo($contest, $site, $c);
+ if($b["siteautojudge"]=="t") {
+ if(DBUpdateRunO($contest, $site, $a["usernumber"], $site, $number, 7, $c)==false) { // 7 means contact staff
+ DBExec($c, "rollback work", "DBGiveUpRunAutojudging(rollback auto)");
+ LOGError("Unable to automatically update a run answer (run=$number, site=$site, ".
+ "contest=$contest, answer='$ans', retval=7)");
+ return false;
+ }
+ LOGLevel("Autojudging automatically answered a run (run=$number, site=$site, contest=$contest, retval=7, answer='$ans')", 3);
+ }
if($ip=="") {
DBExec($c, "update runtable set autoenddate=null, autoanswer=null, autostdout=null, autostderr=null, " .
@@ -753,7 +764,17 @@ function DBNewRun($param,$c=null) {
return 0;
}
} else {
- $dif = $rundatediff;
+ //cassiopc: so we let the run enter the system if it comes with a defined timestamp, but it is to decide later if it will be counted...
+ //$b = DBSiteInfo($contest, $site, $c);
+ $dif = $rundatediff;
+ /*
+ if ($dif >= $b['siteduration']) {
+ DBExec($c, "rollback work", "DBNewRun(rollback-over)");
+ LOGError("Tried to submit a run but the contest is over. SQL=(" . $sql . ")");
+ MSGError("The contest is over!");
+ return 0;
+ }
+ */
}
if($updatetime > $t || $insert) {