diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-11-03 10:15:29 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-11-03 10:15:29 +0000 |
| commit | f99a16bd90e8a3d3b4e8f9ecfe4d8f52f54c6e75 (patch) | |
| tree | b9243502c5956216c11c21642b5dca39aba0ced7 | |
| parent | 0843815a126c9f0282113592e54b17e5823624d2 (diff) | |
| download | boca-f99a16bd90e8a3d3b4e8f9ecfe4d8f52f54c6e75.tar.gz boca-f99a16bd90e8a3d3b4e8f9ecfe4d8f52f54c6e75.zip | |
updated scheme for scoreboard sharing
inclusion of extra site parameter in score.sep (to define by usernumber and sitenumber altogether)
bug fix related to showing runs that happened in the future (when integrating scores of sites that started in distinct moments)
bug fix to sort the files in remotescores/ so as the most updated score for each site is taken into account
| -rw-r--r-- | boca-1.5.2/src/fscore.php | 9 | ||||
| -rw-r--r-- | boca-1.5.2/src/scoretable.php | 4 | ||||
| -rw-r--r-- | boca-1.5.2/src/site/putfile.php | 13 | ||||
| -rw-r--r-- | boca-1.5.2/tools/icpc.etc.tgz | bin | 9525 -> 9525 bytes | |||
| -rwxr-xr-x | boca-1.5.2/tools/updatescore.sh | 2 |
5 files changed, 21 insertions, 7 deletions
diff --git a/boca-1.5.2/src/fscore.php b/boca-1.5.2/src/fscore.php index 9624e87..d2b203e 100644 --- a/boca-1.5.2/src/fscore.php +++ b/boca-1.5.2/src/fscore.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// Last modified 05/aug/2012 by cassio@ime.usp.br +// Last modified 02/nov/2012 by cassio@ime.usp.br ////////////////////////////funcoes para placar/////////////////////////////////////////////// function ScoreCMP($a,$b) { @@ -99,7 +99,7 @@ function DBScore($contest, $verifylastmile, $hor=-1, $globalsite='0') { } else { if(is_array($arr)) { if(isset($arr['site'])) { - $site=$arr['site']; + $site=$arr['site']; //if($overloadsite>0) $site=$overloadsite; if(!in_array($site, $whichsites) && !in_array(0,$whichsites)) continue; $fine=1; reset($resp); @@ -311,14 +311,15 @@ function DBScoreSite($contest, $site, $verifylastmile, $hor=-1, $data=null) { $resp[$user]["problem"][$problem]["penalty"] = 0; $resp[$user]["problem"][$problem]["count"] = 0; - while ($i<$n && $a[$i]["user"]==$user && $a[$i]["problem"]==$problem && $a[$i]["yes"]!='t') { + while ($i<$n && $a[$i]["anstime"] <= $ta && $a[$i]["user"]==$user && $a[$i]["problem"]==$problem && $a[$i]["yes"]!='t') { $time += (int) (($ct["contestpenalty"])/60); $k++; $i++; } + $resp[$user]["problem"][$problem]["count"] = $k; if ($i>=$n) break; - if($a[$i]["user"]==$user && $a[$i]["problem"]==$problem && $a[$i]["yes"]=='t') { + if($a[$i]["anstime"] <= $ta && $a[$i]["user"]==$user && $a[$i]["problem"]==$problem && $a[$i]["yes"]=='t') { $timet = (int) (($a[$i]["time"])/60); if(!isset($resp[$user]["first"]) || $timet < $resp[$user]["first"]) $resp[$user]["first"] = $timet; diff --git a/boca-1.5.2/src/scoretable.php b/boca-1.5.2/src/scoretable.php index 383705d..bc6cf47 100644 --- a/boca-1.5.2/src/scoretable.php +++ b/boca-1.5.2/src/scoretable.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -//Last updated 10/jul/2012 by cassio@ime.usp.br +//Last updated 02/nov/2012 by cassio@ime.usp.br require_once("db.php"); $locr=$_SESSION["locr"]; @@ -245,8 +245,10 @@ if($redo) { else if(strpos($grname[$k],'/') >= 1) { $u1 = explode('/',$grname[$k]); if(isset($u1[1]) && $score[$e]['user'] >= $u1[0] && $score[$e]['user'] <= $u1[1]) { + if(!isset($u1[2]) || $u1[2]==$score[$e]['site']) { $score[$e]['classingroup'][$rfi]=$class; $class++; + } } } diff --git a/boca-1.5.2/src/site/putfile.php b/boca-1.5.2/src/site/putfile.php index 53964d4..8a1d89a 100644 --- a/boca-1.5.2/src/site/putfile.php +++ b/boca-1.5.2/src/site/putfile.php @@ -15,9 +15,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -//Last updated 10/jul/2012 by cassio@ime.usp.br +//Last updated 03/nov/2012 by cassio@ime.usp.br // //PC^2 integration developed by Fabio Antonio Avellaneda Pachon +// +//Now it is also the integration of scores of BOCA +// $quiet=true; require 'header.php'; $ds = DIRECTORY_SEPARATOR; @@ -157,6 +160,13 @@ if(is_writable($_SESSION["locr"] . $remotedir)) { $total=base64_encode(serialize($total)); } else $total=$_POST['data']; + + if($_SESSION["usertable"]["usericpcid"] != '' && $_SESSION["usertable"]["usericpcid"] > 0) + { + $arr = unserialize(base64_decode($total)); + $arr['site']=$_SESSION["usertable"]["usericpcid"]; + $total=base64_encode(serialize($arr)); + } $fn = tempnam($_SESSION["locr"] . $remotedir,"score_"); $fout = fopen($fn,"wb"); @@ -169,6 +179,7 @@ if(is_writable($_SESSION["locr"] . $remotedir)) { !is_array($arr) || !isset($arr['site'])) { echo "FAILED: File " . $fn . " is not compatible\n"; } else { + if(@rename($fn, $_SESSION["locr"] . $remotedir . $ds . "score_" . $_SESSION["usertable"]["username"] . "_" . $_SESSION["usertable"]["usericpcid"] . "_" . md5(getIP()) . ".dat")) echo "SCORE UPLOADED OK\n"; diff --git a/boca-1.5.2/tools/icpc.etc.tgz b/boca-1.5.2/tools/icpc.etc.tgz Binary files differindex f7264c4..7086f48 100644 --- a/boca-1.5.2/tools/icpc.etc.tgz +++ b/boca-1.5.2/tools/icpc.etc.tgz diff --git a/boca-1.5.2/tools/updatescore.sh b/boca-1.5.2/tools/updatescore.sh index 6cf9489..546e17f 100755 --- a/boca-1.5.2/tools/updatescore.sh +++ b/boca-1.5.2/tools/updatescore.sh @@ -15,7 +15,7 @@ # // You should have received a copy of the GNU General Public License # // along with this program. If not, see <http://www.gnu.org/licenses/>. # //////////////////////////////////////////////////////////////////////////////// -# last updated 06/aug/2012 by cassio@ime.usp.br +# last updated 01/nov/2012 by cassio@ime.usp.br if [ "`id -u`" != "0" ]; then echo "Must be run as root" exit 1 |