aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-11-02 17:45:39 +0000
committercassiopc <cassiopc@gmail.com>2012-11-02 17:45:39 +0000
commit0843815a126c9f0282113592e54b17e5823624d2 (patch)
treed346f0f3a5e291ff7170f5261c07affb29e1f2e3
parentf332739571d7929d97b0e503b1160d61d557fcfc (diff)
downloadboca-0843815a126c9f0282113592e54b17e5823624d2.tar.gz
boca-0843815a126c9f0282113592e54b17e5823624d2.zip
small score visualization bug fix; sort of score files to produce the most recent score bug fix
-rw-r--r--boca-1.5.2/src/fscore.php6
-rw-r--r--boca-1.5.2/src/hide.js2
-rw-r--r--boca-1.5.2/src/private/score.sep3
-rw-r--r--boca-1.5.2/src/scoretable.php14
-rw-r--r--boca-1.5.2/tools/icpc.etc.tgzbin9525 -> 9525 bytes
5 files changed, 21 insertions, 4 deletions
diff --git a/boca-1.5.2/src/fscore.php b/boca-1.5.2/src/fscore.php
index efc4858..9624e87 100644
--- a/boca-1.5.2/src/fscore.php
+++ b/boca-1.5.2/src/fscore.php
@@ -85,7 +85,11 @@ function DBScore($contest, $verifylastmile, $hor=-1, $globalsite='0') {
$ds = DIRECTORY_SEPARATOR;
if($ds=="") $ds = "/";
$probs=DBGetProblems($contest); $nprobs=count($probs);
- foreach (glob($_SESSION['locr'] . $ds . "private" .$ds . "remotescores" . $ds . "score*.dat") as $fname) {
+
+ $scoreitems = glob($_SESSION['locr'] . $ds . "private" .$ds . "remotescores" . $ds . "score*.dat", GLOB_NOSORT);
+ array_multisort(array_map('filemtime', $scoreitems), SORT_NUMERIC, SORT_DESC, $scoreitems);
+
+ foreach ($scoreitems as $fname) {
$namear=explode('_',$fname);
$overloadsite=-1;
if(isset($namear[3]) && is_numeric($namear[2])) $overloadsite=$namear[2];
diff --git a/boca-1.5.2/src/hide.js b/boca-1.5.2/src/hide.js
index beaa84e..6f27fd2 100644
--- a/boca-1.5.2/src/hide.js
+++ b/boca-1.5.2/src/hide.js
@@ -21,7 +21,7 @@ elem.className = s;
function toggleGroup(n) {
//alert(n);
var currentClass = document.getElementById("myscoretable");
- for (var i=1; i<20; i++) {
+ for (var i=1; i<999; i++) {
modifyClassName(currentClass,true,"sitehide"+i);
}
modifyClassName(currentClass,false,"sitehide"+n);
diff --git a/boca-1.5.2/src/private/score.sep b/boca-1.5.2/src/private/score.sep
index a61b979..fb45aae 100644
--- a/boca-1.5.2/src/private/score.sep
+++ b/boca-1.5.2/src/private/score.sep
@@ -1,4 +1,4 @@
-General 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 100
+General 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 100 9999
Site_1 1
Site_2 2
Site_3 3
@@ -20,3 +20,4 @@ Site_18 18
Site_19 19
Site_20 20
Site_100 100
+Site_9999 9999
diff --git a/boca-1.5.2/src/scoretable.php b/boca-1.5.2/src/scoretable.php
index dcfc7a6..383705d 100644
--- a/boca-1.5.2/src/scoretable.php
+++ b/boca-1.5.2/src/scoretable.php
@@ -96,6 +96,7 @@ if(file_exists($scoretmp)) {
}
if($_SESSION["usertable"]["usertype"]=='score' || $_SESSION["usertable"]["usertype"]=='admin' || (isset($_GET["remote"]) && is_numeric($_GET["remote"]))) {
+ $privatedir = $_SESSION['locr'] . $ds . "private";
$remotedir = $_SESSION['locr'] . $ds . "private" . $ds . "remotescores";
$destination = $remotedir . $ds ."scores.zip";
if(is_writable($remotedir)) {
@@ -107,11 +108,22 @@ if($_SESSION["usertable"]["usertype"]=='score' || $_SESSION["usertable"]["userty
$data0 = array();
if($level>0) {
list($score,$data0) = DBScoreSite($_SESSION["usertable"]["contestnumber"],
+ $_SESSION["usertable"]["usersitenumber"], 0, -1);
+ }
+ $ct=DBGetActiveContest();
+ $localsite=$ct['contestlocalsite'];
+ $fname = $privatedir . $ds . "score_localsite_" . $localsite . "_" . md5($_SERVER['HTTP_HOST']);
+ @file_put_contents($fname . ".tmp",base64_encode(serialize($data0)));
+ @rename($fname . ".tmp",$fname . ".dat");
+
+ $data0 = array();
+ if($level>0) {
+ list($score,$data0) = DBScoreSite($_SESSION["usertable"]["contestnumber"],
$_SESSION["usertable"]["usersitenumber"], 1, -1);
}
$ct=DBGetActiveContest();
$localsite=$ct['contestlocalsite'];
- $fname = $remotedir . $ds . "score_site" . $localsite . "_" . md5($_SERVER['HTTP_HOST']);
+ $fname = $remotedir . $ds . "score_site" . $localsite . "_" . $localsite . "_" . md5($_SERVER['HTTP_HOST']);
@file_put_contents($fname . ".tmp",base64_encode(serialize($data0)));
@rename($fname . ".tmp",$fname . ".dat");
diff --git a/boca-1.5.2/tools/icpc.etc.tgz b/boca-1.5.2/tools/icpc.etc.tgz
index 8600bf1..f7264c4 100644
--- a/boca-1.5.2/tools/icpc.etc.tgz
+++ b/boca-1.5.2/tools/icpc.etc.tgz
Binary files differ