aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-11-07 16:18:11 +0000
committercassiopc <cassiopc@gmail.com>2012-11-07 16:18:11 +0000
commit987375d85eb88fd1a974b7d99e5288fe3f796b21 (patch)
tree9587eea0f45f0d541b4dff0d88dda5d41de72d7b
parent861ca8a5878d70549dae12b1ea84c5433e2372a6 (diff)
downloadboca-987375d85eb88fd1a974b7d99e5288fe3f796b21.tar.gz
boca-987375d85eb88fd1a974b7d99e5288fe3f796b21.zip
fixes admin/report/webcast.php to be part of the sync, and a couple of typos in it.
-rw-r--r--boca-1.5.2/src/admin/report/webcast.php190
-rw-r--r--boca-1.5.2/tools/icpc.etc.tgzbin9525 -> 9525 bytes
2 files changed, 190 insertions, 0 deletions
diff --git a/boca-1.5.2/src/admin/report/webcast.php b/boca-1.5.2/src/admin/report/webcast.php
new file mode 100644
index 0000000..5a595fc
--- /dev/null
+++ b/boca-1.5.2/src/admin/report/webcast.php
@@ -0,0 +1,190 @@
+<?php
+////////////////////////////////////////////////////////////////////////////////
+//BOCA Online Contest Administrator
+// Copyright (C) 2003-2012 by BOCA System (bocasystem@gmail.com)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// 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 07/nov/2012 by cassio@ime.usp.br
+
+require('header.php');
+
+$contest = $_SESSION["usertable"]["contestnumber"];
+$site = $_SESSION["usertable"]["usersitenumber"];
+
+$ct = DBContestInfo($contest);
+if(($st = DBSiteInfo($contest, $site)) == null)
+ ForceLoad("../index.php");
+
+//if(isset($_GET['full']) && $_GET['full'] > 0)
+ $freezeTime = $st['siteduration'];
+//else
+// $freezeTime = $st['sitelastmilescore'];
+
+$contestfile = $ct['contestname'] . "\n";
+
+$contestfile = $contestfile .
+ $ct['contestduration']/60 . '' .
+ $ct['contestlastmileanswer']/60 . '' .
+ $ct['contestlastmilescore']/60 . '' .
+ $ct['contestpenalty']/60 . "\n";
+
+$c = DBConnect();
+$r = DBExec($c,
+ 'SELECT problemnumber FROM problemtable' .
+ ' WHERE contestnumber = ' . $contest .
+ ' AND problemnumber > 0');
+$numProblems = DBnlines($r);
+$r = DBExec($c,
+ 'SELECT username, userfullname FROM usertable' .
+ ' WHERE contestnumber = ' . $contest .
+ ' AND userenabled = \'t\' AND usersitenumber = ' . $site .
+ ' AND usertype = \'team\'');
+$numTeams = DBnlines($r);
+
+$contestfile = $contestfile .
+ $numTeams . '' .
+ $numProblems . "\n";
+
+for ($i = 0; $i < $numTeams; $i++) {
+ $a = DBRow($r, $i);
+ $teamID = $a['username'];
+ if(isset($a['usershortname']))
+ $teamName = $a['usershortname'];
+ else
+ $teamName = $a['userfullname'];
+ if(isset($a['usershortinstitution']))
+ $teamUni = $a['usershortinstitution'];
+ else
+ $teamUni = $teamName;
+
+ $contestfile = $contestfile .
+ $teamID . '' .
+ $teamUni . '' .
+ $teamName . "\n";
+}
+
+$contestfile = $contestfile .
+ '1' . '' . '1' . "\n";
+$contestfile = $contestfile .
+ $numProblems . '' . 'Y' . "\n";
+
+$score = DBScore($_SESSION["usertable"]["contestnumber"], false, -1, $ct["contestlocalsite"]);
+
+//$contestfile = $contestfile .
+// "<h2>ICPC Output</h2>";
+//$contestfile = $contestfile .
+// "<pre>";
+$n=0;
+$class=1;
+while(list($e, $c) = each($score)) {
+ if(isset($score[$e]["site"]) && isset($score[$e]["user"])) {
+ if(DBSiteInfo($_SESSION["usertable"]["contestnumber"],$score[$e]["site"]) != null) {
+ $r = DBUserInfo($_SESSION["usertable"]["contestnumber"],
+ $score[$e]["site"], $score[$e]["user"]);
+ $contestfile = $contestfile .
+ $r["usericpcid"] . "," .
+ $class++ . "," .
+ $score[$e]["totalcount"] . "," .
+ $score[$e]["totaltime"] . ",";
+
+ if($score[$e]["first"])
+ $contestfile = $contestfile . $score[$e]["first"] . "\n";
+ else $contestfile = $contestfile . "0\n";
+ $n++;
+ }
+ }
+}
+//$contestfile = $contestfile .
+// "</pre>";
+
+$timefile = $st['currenttime'];
+$versionfile = '1.0' . "\n";
+
+$run = DBAllRunsInSites($contest, $site, 'run');
+
+$numRuns = count($run);
+
+$runfile = '';
+for ($i = 0; $i < $numRuns; $i++) {
+ $u = DBUserInfo($contest, $site, $run[$i]['user']);
+
+ $runID = $run[$i]['number'];
+ $runTime = dateconvminutes($run[$i]['timestamp']);
+ $runTeam = $u['username'];
+ $runProblem = $run[$i]['problem'];
+
+ if ($runTime > $freezeTime) {
+ continue;
+ }
+
+ $runfile = $runfile .
+ $runID . '' .
+ $runTime . '' .
+ $runTeam . '' .
+ $runProblem . '';
+
+ if ($run[$i]['yes']=='t') {
+ $runfile = $runfile .
+ 'Y' . "\n";
+ } else if ($run[$i]['answer'] == 'Not answered yet') {
+ $runfile = $runfile .
+ '?' . "\n";
+ } else {
+ $runfile = $runfile .
+ 'N' . "\n";
+ }
+}
+
+$ds = DIRECTORY_SEPARATOR;
+if($ds=="") $ds = "/";
+
+if(isset($_SESSION['locr'])) {
+ $webcastdir = $_SESSION['locr'] . $ds . 'private' .$ds. 'webcast';
+ $webcastparentdir = $_SESSION['locr'] . $ds. 'private';
+} else {
+ $webcastdir = $locr . $ds . 'private' . $ds . 'webcast';
+ $webcastparentdir = $locr . $ds . 'private';
+}
+cleardir($webcastdir);
+@mkdir($webcastdir);
+if(is_writable($webcastdir)) {
+ file_put_contents($webcastdir . $ds . 'runs',$runfile);
+ file_put_contents($webcastdir . $ds . 'contest',$contestfile);
+ file_put_contents($webcastdir . $ds . 'version',$versionfile);
+ file_put_contents($webcastdir . $ds . 'time',$timefile);
+ if(@create_zip($webcastparentdir,array('webcast'),$webcastdir . ".tmp") != 1) {
+ LOGError("Cannot create score webcast.tmp file");
+ MSGError("Cannot create score webcast.tmp file");
+ } else {
+ $cf = globalconf();
+ file_put_contents($webcastdir . ".tmp",encryptData(file_get_contents($webcastdir . ".tmp"), $cf["key"],false));
+ @rename($webcastdir . ".tmp",$webcastdir . '.zip');
+ }
+ echo "<br><br><br><center>";
+ echo "<a href=\"$locr/filedownload.php?".
+ filedownload(-1,$webcastdir . '.zip') . "\">CLICK TO DOWNLOAD</a>";
+ echo "</center>";
+} else {
+ LOGError('Error creating the folder for the ZIP file: '. $webcastdir);
+ MSGError('Error creating the folder for the ZIP file: '.$webcastdir);
+ ForceLoad("../index.php");
+}
+echo "<br><br><br>\n";
+echo "<br><br><br>\n";
+echo "<br><br><br>\n";
+echo "<br><br><br>\n";
+echo "<br><br><br>\n";
+echo "<br><br><br>\n";
+?>
+<?php include("$locr/footnote.php"); ?>
diff --git a/boca-1.5.2/tools/icpc.etc.tgz b/boca-1.5.2/tools/icpc.etc.tgz
index 12d92b2..31b46cb 100644
--- a/boca-1.5.2/tools/icpc.etc.tgz
+++ b/boca-1.5.2/tools/icpc.etc.tgz
Binary files differ