aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2018-09-05 12:55:12 +0000
committercassio <cassiopc@gmail.com>2018-09-05 12:55:12 +0000
commit034545b62ea8e7e10d544b40e1bb78778a874f71 (patch)
tree9ab6623276e73aac2ae53407d4a5b751fcab3e05
parent6cefeaeb0a2992b48315d253d2528278a6445251 (diff)
downloadboca-034545b62ea8e7e10d544b40e1bb78778a874f71.tar.gz
boca-034545b62ea8e7e10d544b40e1bb78778a874f71.zip
more details in clock and fix of timestamp
-rw-r--r--src/fcontest.php8
-rw-r--r--src/frun.php3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index 9989931..ccd3e11 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -1387,6 +1387,10 @@ function siteclock() {
return array("contest not running",-1000000000);
if ($s["currenttime"]<0) {
$t = - $s["currenttime"];
+ if($t>3600*24) {
+ $t = ((int) ($t/(360*24)))/10;
+ return array("&gt; ". $t . " day(s) to start",$s["currenttime"]);
+ }
if($t>3600) {
$t = ((int) ($t/360))/10;
return array("&gt; ". $t . " hour(s) to start",$s["currenttime"]);
@@ -1401,6 +1405,10 @@ function siteclock() {
if ($s["currenttime"]>=0) {
$t = $s["siteduration"] - $s["currenttime"];
$str = '';
+ if($t >= 3600*24) {
+ $str .= ((int)($t/(3600*24))) . 'd ';
+ $t = $t % (3600*24);
+ }
if($t >= 3600) {
$str .= ((int)($t/3600)) . 'h ';
$t = $t % 3600;
diff --git a/src/frun.php b/src/frun.php
index bc9dc2f..9e6e528 100644
--- a/src/frun.php
+++ b/src/frun.php
@@ -166,9 +166,10 @@ function DBUpdateRunC($contest, $usersite, $usernumber, $runsite, $runnumber, $a
if($chief == 1 || ($outra != 0 && $outra == $answer && $temp["runstatus"] != "judged+") ||
($outra != 0 && $outra == $answer && $temp["runanswer"]==$answer)) {
$newstatus = 'judged';
+ $tans = max($t,$temp['rundatediff']);
DBExec($c, "update runtable set runstatus='judged', " .
"runjudge=$usernumber, runjudgesite=$usersite, " .
- "runanswer=$answer, rundatediffans=$t, updatetime=".time()." " .
+ "runanswer=$answer, rundatediffans=$tans, updatetime=".time()." " .
"where contestnumber=$contest and runnumber=$runnumber and runsitenumber=$runsite",
"DBUpdateRunC(update run)");