diff options
| -rw-r--r-- | debian/changelog | 8 | ||||
| -rw-r--r-- | src/admin/report/webcast.php | 142 | ||||
| -rw-r--r-- | src/filedownload.php | 6 | ||||
| -rw-r--r-- | src/filewindow.php | 4 | ||||
| -rwxr-xr-x | src/globals.php | 6 | ||||
| -rw-r--r-- | src/judge/allrunlist.php | 153 | ||||
| -rw-r--r-- | src/judge/header.php | 3 | ||||
| -rw-r--r-- | src/judge/runchief.php | 3 | ||||
| -rw-r--r-- | src/judge/runview.php | 237 | ||||
| -rw-r--r-- | src/staff/report/score.php | 43 | ||||
| -rwxr-xr-x | src/staff/run.php | 27 | ||||
| -rw-r--r-- | src/team/problem.php | 30 |
12 files changed, 602 insertions, 60 deletions
diff --git a/debian/changelog b/debian/changelog index ae5cbe3..85ed23f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +boca (1.5.14-8ubuntu4) focal; urgency=medium + + * Compatible with Ubuntu focal + * Merges from 2018 and 2019 modifications + * Merge changes from 2020 + + -- Bruno Cesar Ribas <bruno.ribas@unb.br> Thu, 16 Nov 2020 15:35:22 -0300 + boca (1.5.14-8) bionic; urgency=medium * LATAM fixes diff --git a/src/admin/report/webcast.php b/src/admin/report/webcast.php index 58a71b1..5189809 100644 --- a/src/admin/report/webcast.php +++ b/src/admin/report/webcast.php @@ -16,6 +16,9 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// +//echo "DISABLED"; +//return; + require('header.php'); if(!isset($_GET['webcastcode']) || !ctype_alnum($_GET['webcastcode'])) exit; $webcastcode=$_GET['webcastcode']; @@ -74,7 +77,24 @@ if(isset($_GET['full']) && $_GET['full'] > 0) else $freezeTime = $st['sitelastmilescore']; +$freezeTime = $st['siteduration']; + +$sql = 'SELECT username, userfullname, userdesc FROM usertable' . + ' WHERE contestnumber = ' . $contest . + ' AND userenabled = \'t\' AND usertype = \'team\' AND ((0 = 1)'; +// ' AND userenabled = \'t\' AND not (usericpcid = \'\') AND not (usericpcid = \'000000\') AND not (usericpcid = \'0\') AND usertype = \'team\' AND ((0 = 1)'; +$sqlusersruns='( (0 = 1 )'; +for($i=0; $i < count($wcloweruser); $i++) +{ + $sql .= ' OR (usersitenumber = ' . $wcsite[$i] . ' AND usernumber >= ' . $wcloweruser[$i] . ' AND usernumber <= ' . $wcupperuser[$i] . ')'; + $sqlusersruns .= ' OR (u.usernumber >= ' . $wcloweruser[$i] . ' AND u.usernumber <= ' . $wcupperuser[$i] . ')'; +} +$sql .= ')'; +$sqlusersruns .= ')'; +$contestfile=''; +if(!file_exists($webcastdir . $ds . 'contest') || filemtime($webcastdir . $ds . 'contest') < time() - 3600) +{ $contestfile = $ct['contestname'] . "\n"; $contestfile = $contestfile . @@ -90,13 +110,6 @@ $r = DBExec($c, ' AND problemnumber > 0 AND not (problemfullname ~ \'(DEL)\')'); $numProblems = DBnlines($r); -$sql = 'SELECT username, userfullname, userdesc FROM usertable' . - ' WHERE contestnumber = ' . $contest . - ' AND userenabled = \'t\' AND usertype = \'team\' AND ((0 = 1)'; -// ' AND userenabled = \'t\' AND not (usericpcid = \'\') AND not (usericpcid = \'000000\') AND not (usericpcid = \'0\') AND usertype = \'team\' AND ((0 = 1)'; -for($i=0; $i < count($wcloweruser); $i++) - $sql .= ' OR (usersitenumber = ' . $wcsite[$i] . ' AND usernumber >= ' . $wcloweruser[$i] . ' AND usernumber <= ' . $wcupperuser[$i] . ')'; -$sql .= ')'; $r = DBExec($c,$sql); $numTeams = DBnlines($r); @@ -108,7 +121,7 @@ $teamIDs = array(); for ($i = 0; $i < $numTeams; $i++) { $a = DBRow($r, $i); $teamID = $a['username']; - $teamIDs[count($teamIDs)] = $teamID; + //$teamIDs[count($teamIDs)] = $teamID; $pieces = explode('</b>', $a['userfullname']); $teamName = $a['userfullname']; $pieces = explode(']', $a['userdesc']); @@ -145,34 +158,112 @@ $contestfile = $contestfile . '1' . '' . '1' . "\n"; $contestfile = $contestfile . $numProblems . '' . 'Y' . "\n"; +} -$run = DBAllRunsInSites($contest, $site, 'run'); +function LocalGetRuns($contest,$site,$st,$extraquery,$order='run') { + $c = DBConnect(); + $sql = "select distinct r.runnumber as number, r.rundatediff as timestamp, " . + "p.problemname as problem, r.runstatus as status, " . + "a.yes as yes, u.username as username, " . + "a.runanswer as answer " . + "from runtable as r, problemtable as p, answertable as a, usertable as u " . + "where r.contestnumber=$contest and p.contestnumber=r.contestnumber and u.contestnumber=r.contestnumber and " . + "r.runproblem=p.problemnumber and r.usernumber=u.usernumber and r.runsitenumber=u.usersitenumber and " . + "a.answernumber=r.runanswer and " . + $extraquery . " AND " . + "a.contestnumber=r.contestnumber"; + if (strpos($site,"x")===false) { + $str = explode(",", $site); + $sql .= " and (r.runsitenumber=-1"; + for ($i=0;$i<count($str);$i++) { + if (is_numeric($str[$i])) $sql .= " or r.runsitenumber=".$str[$i]; + } + $sql .= ")"; + } + + if ($st == 1) { + $sql .= " and (not (r.runjudge1=". $_SESSION["usertable"]["usernumber"] . " and " . + "r.runjudgesite1=". $_SESSION["usertable"]["usersitenumber"] . " and r.runanswer1!=0)) and "; + $sql .= " (not (r.runjudge2=". $_SESSION["usertable"]["usernumber"] . " and " . + "r.runjudgesite2=". $_SESSION["usertable"]["usersitenumber"] . " and r.runanswer2!=0)) and " . + + "(not ((r.runjudge1!=". $_SESSION["usertable"]["usernumber"] . " or " . + "r.runjudgesite1!=". $_SESSION["usertable"]["usersitenumber"] . ") and " . + " (r.runjudge2!=". $_SESSION["usertable"]["usernumber"] . " or " . + "r.runjudgesite2!=". $_SESSION["usertable"]["usersitenumber"] . ") and " . + " (not (r.runjudge1 is null)) and (not (r.runjudge2 is null))))"; + if ($order == 'report') + $sql .= " and (u.usertype != 'judge')"; + $sql .= " and (not r.runstatus = 'judged') " . + " and not r.runstatus ~ 'deleted' order by "; + } else if($st == 2) { + $sql .= " and (not r.runanswer1 = 0) and (not r.runanswer2 = 0) and (not r.runstatus = 'judged') order by "; + } else $sql .= " order by "; + + if($order == "site") + $sql .= "r.runsitenumber,"; + else if ($order == "status") + $sql .= "r.runstatus,"; + else if ($order == "judge") + $sql .= "r.runjudge,r.runjudgesite,"; + else if ($order == "problem") + $sql .= "p.problemname,"; + else if ($order == "language") + $sql .= "l.langname,"; + else if ($order == "answer") + $sql .= "a.runanswer,"; + else if ($order == "user") + $sql .= "r.usernumber,r.runsitenumber,"; + + if ($st == 1 || $order == "report") + $sql .= "r.runnumber"; + else + $sql .= "r.rundatediff desc"; + + $r = DBExec($c, $sql, "DBOpenRunsSNS(get run/prob/lang/ans)"); + + $n = DBnlines($r); + $a = array(); + for ($i=0;$i<$n;$i++) + $a[$i] = DBRow($r,$i); + return $a; +} + +if(isset($_GET['runtimege']) && $_GET['runtimege'] >= 0) + $sqlusersruns.=' AND r.rundatediff >= ' . $_GET['runtimege']*60 .' '; + +//$run = DBAllRunsInSites($contest, $site, 'run'); +$run = LocalGetRuns($contest, $site,-1,$sqlusersruns, 'run'); $numRuns = count($run); + $runfile = ''; for ($i = 0; $i < $numRuns; $i++) { if($run[$i]['status'] == 'deleted') continue; - $u = DBUserInfo($contest, $site, $run[$i]['user']); + //$u = DBUserInfo($contest, $site, $run[$i]['user']); $runID = $run[$i]['number']; $runTime = dateconvminutes($run[$i]['timestamp']); - $runTeam = $u['username']; - if(in_array($runTeam, $teamIDs)) { + //$runTeam = $u['username']; + $runTeam = $run[$i]['username']; + //if(in_array($runTeam, $teamIDs)) { + { $runProblem = $run[$i]['problem']; -if($runTime < $freezeTime) { - $runfile = $runfile . - $runID . '' . +//if($runTime < $freezeTime) { + { + $runfile .= $runID . '' . $runTime . '' . $runTeam . '' . $runProblem . ''; - if ($runTime >= $freezeTime) { - $runfile = $runfile . '?' . "\n"; - } else if ($run[$i]['yes'] == 't') { - $runfile = $runfile . 'Y' . "\n"; + //if ($runTime >= $freezeTime) { + // $runfile .= '?' . "\n"; + //} else if ($run[$i]['yes'] == 't') { + if ($run[$i]['yes'] == 't') { + $runfile .= 'Y' . "\n"; } else if ($run[$i]['answer'] == 'Not answered yet') { - $runfile = $runfile . '?' . "\n"; + $runfile .= '?' . "\n"; } else { - $runfile = $runfile . 'N' . "\n"; + $runfile .= 'N' . "\n"; } } } @@ -191,11 +282,14 @@ $_SESSION["usertable"]["contestnumber"]=1; $_SESSION["usertable"]["usersitenumber"]=1; -$score = DBScore($contest, false, -1, $site); +//$icpcfile=$sqlusersruns; +//$icpcfile=print_r($run,true); $icpcfile=''; $class=1; $nid=1; +if(false){ +$score = DBScore($contest, false, -1, $site); while(list($e, $c) = each($score)) { if(isset($score[$e]["site"]) && isset($score[$e]["user"])) { $r = DBUserInfo($contest, @@ -217,10 +311,12 @@ while(list($e, $c) = each($score)) { } } } +} if(is_writable($webcastdir)) { @file_put_contents($webcastdir . $ds . 'runs',$runfile); - @file_put_contents($webcastdir . $ds . 'contest',$contestfile); + if($contestfile!='') + @file_put_contents($webcastdir . $ds . 'contest',$contestfile); @file_put_contents($webcastdir . $ds . 'version',$versionfile); @file_put_contents($webcastdir . $ds . 'time',$timefile); @file_put_contents($webcastdir . $ds . 'icpc',$icpcfile); diff --git a/src/filedownload.php b/src/filedownload.php index e1ef6b9..df45beb 100644 --- a/src/filedownload.php +++ b/src/filedownload.php @@ -34,12 +34,12 @@ if(!isset($_GET["oid"]) || !is_numeric($_GET["oid"]) || !isset($_GET["filename"] } $cf = globalconf(); -$fname = decryptData(myrawurldecode($_GET["filename"]), session_id() . $cf["key"]); +$fname = decryptData(myrawurldecode($_GET["filename"]), $uglysalt . $cf["key"]); if(isset($_GET["msg"])) - $p = myhash($_GET["oid"] . $fname . myrawurldecode($_GET["msg"]) . session_id() . $cf["key"]); + $p = myhash($_GET["oid"] . $fname . myrawurldecode($_GET["msg"]) . $uglysalt . $cf["key"]); else - $p = myhash($_GET["oid"] . $fname . session_id() . $cf["key"]); + $p = myhash($_GET["oid"] . $fname . $uglysalt . $cf["key"]); if($p != $_GET["check"]) { echo "<html><head><title>View Page</title>"; diff --git a/src/filewindow.php b/src/filewindow.php index 375fac0..e685792 100644 --- a/src/filewindow.php +++ b/src/filewindow.php @@ -36,12 +36,12 @@ if(!isset($_GET["oid"]) || !is_numeric($_GET["oid"]) || !isset($_GET["filename"] } $cf = globalconf(); -$fname = decryptData(myrawurldecode($_GET["filename"]), session_id() . $cf["key"]); +$fname = decryptData(myrawurldecode($_GET["filename"]), $uglysalt . $cf["key"]); $msg = ''; if(isset($_GET["msg"])) $msg = myrawurldecode($_GET["msg"]); -$p = myhash($_GET["oid"] . $fname . $msg . session_id() . $cf["key"]); +$p = myhash($_GET["oid"] . $fname . $msg . $uglysalt . $cf["key"]); if($p != $_GET["check"]) { echo "<html><head><title>View Page</title>"; diff --git a/src/globals.php b/src/globals.php index b7cecd4..293e962 100755 --- a/src/globals.php +++ b/src/globals.php @@ -19,6 +19,8 @@ require_once('db.php'); define("dbcompat_1_4_1",true); +$uglysalt="30a2224c82dcf42e497e2a1f6bd6516b"; + // sanitization function sanitizeVariables(&$item, $key) { @@ -38,8 +40,8 @@ function myrawurldecode($txt) { function filedownload($oid,$fname,$msg='') { $cf = globalconf(); - $if = myrawurlencode(encryptData($fname, session_id() . $cf['key'],false)); - $p = myhash($oid . $fname . $msg . session_id() . $cf["key"]); + $if = myrawurlencode(encryptData($fname, $uglysalt . $cf['key'],false)); + $p = myhash($oid . $fname . $msg . $uglysalt . $cf["key"]); $str = "oid=". $oid . "&filename=". $if . "&check=" . $p; if($msg != '') $str .= "&msg=" . myrawurlencode($msg); return $str; diff --git a/src/judge/allrunlist.php b/src/judge/allrunlist.php new file mode 100644 index 0000000..47d10c1 --- /dev/null +++ b/src/judge/allrunlist.php @@ -0,0 +1,153 @@ +<?php +//////////////////////////////////////////////////////////////////////////////// +//BOCA Online Contest Administrator +// Copyright (C) 2003-2012 by BOCA Development Team (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 modified 05/aug/2012 by cassio@ime.usp.br +require 'header.php'; +$runeditphp='runview.php'; +if(isset($_GET["order"]) && $_GET["order"] != "") { +$order = myhtmlspecialchars($_GET["order"]); + $_SESSION["runline"] = $order; +} else { + if(isset($_SESSION["runline"])) + $order = $_SESSION["runline"]; + else + $order = ''; +} +?> + +<form name="form1" method="post" action="<?php echo $runphp; ?>"> + <input type=hidden name="confirmation" value="noconfirm" /> +<br> +<table width="100%" border=1> + <tr> + <td><b><a href="<?php echo $runphp; ?>?order=run">Run #</a></b></td> + <td><b><a href="<?php echo $runphp; ?>?order=site">Site</a></b></td> +<?php if($runphp == "run.php") { ?> + <td><b><a href="<?php echo $runphp; ?>?order=user">User</a></b></td> +<?php } ?> + <td><b>Time</b></td> + <td><b><a href="<?php echo $runphp; ?>?order=problem">Problem</a></b></td> + <td><b><a href="<?php echo $runphp; ?>?order=language">Language</a></b></td> +<!-- <td><b>Filename</b></td> --> + <td><b><a href="<?php echo $runphp; ?>?order=status">Status</a></b></td> +<!-- <td><b><a href="<?php echo $runphp; ?>?order=judge">Judge (Site)</a></b></td> --> +<!-- <td><b>AJ</b></td> --> + <td><b><a href="<?php echo $runphp; ?>?order=answer">Answer</a></b></td> + </tr> +<?php +if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null) + ForceLoad("../index.php"); + +// forca aparecer as runs do proprio site +if (trim($s["sitejudging"])!="") $s["sitejudging"].=",".$_SESSION["usertable"]["usersitenumber"]; +else $s["sitejudging"]=$_SESSION["usertable"]["usersitenumber"]; + +$run = DBAllRunsInSites($_SESSION["usertable"]["contestnumber"], $s["sitejudging"], $order); + +for($judged=0; $judged<2; $judged++) { +for ($i=0; $i<count($run); $i++) { + if($run[$i]["status"] == 'gone') continue; + if(($run[$i]['status'] != 'judged' && $judged==0) || + ($run[$i]['status'] == 'judged' && $judged==1)) { + +#for ($i=0; $i<count($run); $i++) { + if($run[$i]["answer1"] != 0 && $run[$i]["answer2"] != 0 && ($run[$i]["status"] != "judged" && $run[$i]["status"] != 'deleted')) { + if($runphp == "runchief.php") + echo " <tr bgcolor=\"ff0000\">\n"; + else echo "<tr>\n"; + echo " <td nowrap bgcolor=\"ff0000\">"; + } + else { + echo " <tr><td nowrap>"; + } + //echo "<input type=\"checkbox\" name=\"cbox_" . $run[$i]["number"] . "_" . $run[$i]["site"] . "\" />"; + echo " <a href=\"" . $runeditphp . "?runnumber=".$run[$i]["number"]."&runsitenumber=".$run[$i]["site"] . + "\">" . $run[$i]["number"] . "</a></td>\n"; + + echo " <td nowrap>" . $run[$i]["site"] . "</td>\n"; + if($runphp == "run.php") { + if ($run[$i]["user"] != "") { + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["site"], $run[$i]["user"]); + echo " <td nowrap>" . $u["username"] . "</td>\n"; + } + } + echo " <td nowrap>" . dateconvminutes($run[$i]["timestamp"]) . "</td>\n"; + echo " <td nowrap>" . $run[$i]["problem"] . "</td>\n"; + echo " <td nowrap>" . $run[$i]["language"] . "</td>\n"; +// echo " <td nowrap>" . $run[$i]["filename"] . "</td>\n"; + if ($run[$i]["judge"] == $_SESSION["usertable"]["usernumber"] && + $run[$i]["judgesite"] == $_SESSION["usertable"]["usersitenumber"] && $run[$i]["status"] == "judging") + $color="ff7777"; + else if ($run[$i]["status"]== "judged+" && $run[$i]["judge"]=="") $color="ffff00"; + else if ($run[$i]["status"]== "judged") $color="bbbbff"; + else if ($run[$i]["status"] == "judging" || $run[$i]["status"]== "judged+") $color="77ff77"; + else if ($run[$i]["status"] == "openrun") $color="ffff88"; + else $color="ffffff"; + + echo " <td nowrap bgcolor=\"#$color\">" . $run[$i]["status"] . "</td>\n"; + + if(false){ + if ($run[$i]["autoend"] != "") { + $color="bbbbff"; + if ($run[$i]["autoanswer"]=="") $color="ff7777"; + } + else if ($run[$i]["autobegin"]=="") $color="ffff88"; + else $color="77ff77"; + echo "<td bgcolor=\"#$color\"> </td>\n"; + } + + if ($run[$i]["answer"] == "") { + echo " <td> </td>\n"; + } else { + echo " <td>" . $run[$i]["answer"]; + if($run[$i]['yes']=='t') { + echo " <img alt=\"".$run[$i]["colorname"]."\" width=\"10\" ". + "src=\"" . balloonurl($run[$i]["color"]) ."\" />"; + } + echo "</td>\n"; + } + echo " </tr>\n"; +} +} +} + +echo "</table>"; +if (count($run) == 0) echo "<br><center><b><font color=\"#ff0000\">NO RUNS AVAILABLE</font></b></center>"; +else { +?> + <br> +<!-- + <script language="javascript"> + function conf() { + if (confirm("Confirm?")) { + document.form1.confirmation.value='confirm'; + } + } + </script> + <center> +<b>Click on the number of a run to edit it or select them with<br />the checkboxes and use the buttons to work on multiple runs:</b><br /><br /> + <input type="submit" name="auto" value="Re-run autojudge for selected runs" onClick="conf()"> + <input type="submit" name="open" value="Open selected runs for rejudging" onClick="conf()"> +<br><br> + </center> +--> + </form> +<?php +} +?> +</body> +</html> diff --git a/src/judge/header.php b/src/judge/header.php index ac5c699..2874366 100644 --- a/src/judge/header.php +++ b/src/judge/header.php @@ -92,6 +92,9 @@ echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" if($isboss) { echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=runchief.php>Chief ($nrchief)</a></td>\n"; } +{ + echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=allrunlist.php>All runs </a></td>\n"; +} echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=score.php>Score</a></td>\n"; echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=clar.php>Clarifications ($nc)</a></td>\n"; diff --git a/src/judge/runchief.php b/src/judge/runchief.php index b124fd8..ce0e29c 100644 --- a/src/judge/runchief.php +++ b/src/judge/runchief.php @@ -46,6 +46,7 @@ $order = myhtmlspecialchars($_GET["order"]); <td><b><a href="<?php echo $runphp; ?>?order=judge">Judge (Site)</a></b></td> <td><b>AJ</b></td> <td><b><a href="<?php echo $runphp; ?>?order=answer">Answer</a></b></td> + <td><b>Team</b></td> </tr> <?php if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null) @@ -163,6 +164,8 @@ for ($i=0; $i<count($run); $i++) { } echo "</td>\n"; } + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["site"], $run[$i]["user"]); + echo "<td>".$u["username"]."</td>"; echo " </tr>\n"; } } diff --git a/src/judge/runview.php b/src/judge/runview.php new file mode 100644 index 0000000..5ccbabc --- /dev/null +++ b/src/judge/runview.php @@ -0,0 +1,237 @@ +<?php +//////////////////////////////////////////////////////////////////////////////// +//BOCA Online Contest Administrator +// Copyright (C) 2003-2012 by BOCA Development Team (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 modified 05/aug/2012 by cassio@ime.usp.br +require 'header.php'; + +// ??? +$runsitenumber = myhtmlspecialchars($_GET["runsitenumber"]); +$runnumber = myhtmlspecialchars($_GET["runnumber"]); + +if (($a = DBChiefGetRunToAnswer($runnumber, $runsitenumber, + $_SESSION["usertable"]["contestnumber"])) === false) { + MSGError("Another judge got it first."); + ForceLoad($runphp); +} + +$b = DBGetProblemData($_SESSION["usertable"]["contestnumber"], $a["problemnumber"]); +?> +<br><br><center><b>Use the following fields to judge the run: +</b></center> +<form name="form1" method="post" action="<?php echo $runeditphp; ?>"> + <input type=hidden name="confirmation" value="noconfirm" /> + <center> + <table border="1"> + <tr> + <td width="27%" align=right><b>Site:</b></td> + <td width="83%"> + <input type=hidden name="sitenumber" value="<?php echo $a["sitenumber"]; ?>" /> + <?php echo $a["sitenumber"]; ?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Number:</b></td> + <td width="83%"> + <input type=hidden name="number" value="<?php echo $a["number"]; ?>" /> + <?php echo $a["number"]; ?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Time:</b></td> + <td width="83%"> + <?php echo dateconvminutes($a["timestamp"]); ?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Problem</b><i> <?php echo $a["problemname"]; ?></i>: </td> + <td width="83%"> +<?php +for ($i=0;$i<count($b);$i++) { + echo "<b>Input:</b><a href=\"../filedownload.php?". filedownload($b[$i]["inputoid"], $b[$i]["inputfilename"]) ."\">"; + echo $b[$i]["inputfilename"] . "</a>"; + echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('../filewindow.php?". + filedownload($b[$i]["inputoid"], $b[$i]["inputfilename"]) ."', 'View$i - INPUT','width=680,height=600,scrollbars=yes,resizable=yes')\">view</a> "; + + if(isset($b[$i]["soloid"])) { + echo "<b>Sol:</b><a href=\"../filedownload.php?". filedownload($b[$i]["soloid"], $b[$i]["solfilename"]) . "\">"; + echo $b[$i]["solfilename"] . "</a>"; + } + echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('../filewindow.php?". + filedownload($b[$i]["soloid"], $b[$i]["solfilename"]) ."', 'View$i - CORRECT OUTPUT','width=680,height=600,scrollbars=yes,resizable=yes')\">view</a>"; +} +?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Language</b>:</td> + <td width="83%"><i> <?php echo $a["language"]; ?></i> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Source code:</b></td> + <td width="83%"> +<?php + echo "<a href=\"../filedownload.php?". filedownload($a["sourceoid"],$a["sourcename"]) . "\">" . $a["sourcename"] . "</a>\n"; +echo "<a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('../filewindow.php?" . +filedownload($a["sourceoid"],$a["sourcename"]) ."', 'View - SOURCE', ". +"'width=680,height=600,scrollbars=yes,resizable=yes')\">view</a>\n"; +?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Answer 1:</b></td> + <td width="83%"> +<?php +$ans = DBGetAnswers($_SESSION["usertable"]["contestnumber"]); +for ($i=0;$i<count($ans);$i++) + if ($a["answer1"] == $ans[$i]["number"]) { +// if($ans[$i]["fake"] != "t") { + if($a["judgesite1"] != "" && $a["judge1"] != "") { + $uu = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $a["judgesite1"], $a["judge1"]); + echo $ans[$i]["desc"] . " [judge=" . $uu["username"] . " (" . $a["judgesite1"] . ")]"; + } else + echo $ans[$i]["desc"]; + } +?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Answer 2:</b></td> + <td width="83%"> +<?php +$ans = DBGetAnswers($_SESSION["usertable"]["contestnumber"]); +for ($i=0;$i<count($ans);$i++) + if ($a["answer2"] == $ans[$i]["number"]) { +// if($ans[$i]["fake"] != "t") { + if($a["judgesite2"] != "" && $a["judge2"] != "") { + $uu = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $a["judgesite2"], $a["judge2"]); + echo $ans[$i]["desc"] . " [judge=" . $uu["username"] . " (" . $a["judgesite2"] . ")]"; + } else + echo $ans[$i]["desc"]; + } +?> + </td> + </tr> + +<!-- + <tr> + <td width="27%" align=right><b>Notify user:</b></td> + <td width="83%"> + <input class=checkbox type=checkbox name="notifyuser" value="yes" +<?php +if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null) + ForceLoad("../index.php"); + +if ($a["timestamp"] < $s["sitelastmileanswer"]) echo "checked"; ?>> +(do not change this unless you know exactly what you are doing) + </td> + </tr> + <tr> + <td width="27%" align=right><b>Update score board:</b></td> + <td width="83%"> + <input class=checkbox type=checkbox name="updatescore" value="yes" +<?php if ($a["timestamp"] < $s["sitelastmilescore"]) echo "checked"; ?>> +(do not change this unless you know exactly what you are doing) + </td> + </tr> +--> + </table> + </center> + <br> +<!-- + <script language="javascript"> + function conf() { + if (confirm("Confirm?")) { + document.form1.confirmation.value='confirm'; + } + } + </script> + <center> + <input type="submit" name="Submit" value="Judge" onClick="conf()"> + <input type="submit" name="open" value="Open run for rejudging" onClick="conf()"> + <input type="submit" name="cancel" value="Cancel editing"> + <input type="submit" name="delete" value="Delete" onClick="conf()"> + <input type="reset" name="Submit2" value="Clear"> +<br><br> + </center> + +--> + <center> +<br> +<b>Autojudging:</b> +<!-- +<input type="submit" name="giveup" value="Renew"> +--> +<br><br> + <table border="1"> + <tr> + <td width="27%" align=right><b>Autojudging answer:</b></td> + <td width="83%"> +<?php +if($a["autobegin"]!="" && $a["autoend"]=="") + echo "in progress"; +else if($a["autoend"]!="") { + if($a["autoanswer"]!="") echo $a["autoanswer"]; + else echo "Autojudging error"; +} else + echo "unavailable"; +?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Autojudged by:</b></td> +<?php if($a["autobegin"]!="" && $a["autoend"]=="") + echo "<td width=\"83%\">". $a["autoip"] ." since ". dateconvsimple($a["autobegin"]) ."</td>"; +else if($a["autoend"]!="") + echo "<td width=\"83%\">". $a["autoip"] ." from ". dateconvsimple($a["autobegin"]) ." to ". dateconvsimple($a["autoend"]) ."</td>"; +else + echo "<td width=\"83%\">unavailable</td>"; +?> + </tr> + <tr> + <td width="27%" align=right><b>Standard output:</b></td> + <td width="83%"> +<?php +if($a["autostdout"]!="") { + echo "<a href=\"../filedownload.php?".filedownload($a["autostdout"],"stdout") ."\">stdout</a>\n"; + echo "<a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('../filewindow.php?". + filedownload($a["autostdout"],"stdout") ."', 'View - STDOUT','width=680,height=600,scrollbars=yes,". + "resizable=yes')\">view</a>\n"; +} else + echo "unavailable"; +?> + </td> + </tr> + <tr> + <td width="27%" align=right><b>Standard error:</b></td> + <td width="83%"> +<?php +if($a["autostderr"]!="") { + echo "<a href=\"../filedownload.php?". filedownload($a["autostderr"],"stderr") . "\">stderr</a>\n"; + echo "<a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('../filewindow.php?". + filedownload($a["autostderr"],"stderr") ."', 'View - STDERR','width=680,height=600,scrollbars=yes,". + "resizable=yes')\">view</a>\n"; +} else + echo "unavailable"; +?> + </td> + </tr> + </table></center> + +</form> +</body> +</html> diff --git a/src/staff/report/score.php b/src/staff/report/score.php new file mode 100644 index 0000000..0196b3a --- /dev/null +++ b/src/staff/report/score.php @@ -0,0 +1,43 @@ +<?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 10/jul/2012 by cassio@ime.usp.br + +require('header.php'); + +$final = true; +$s = $st; +$des = true; +$detail=true; +if($_GET["p"] == "0") $ver = false; +else if($_GET["p"] == "2") $detail=false; +else { + $ver = true; + $des = false; +} +if(isset($_GET["hor"])) $hor = $_GET["hor"]; +else $hor = -1; + +if ($s["currenttime"] >= $s["sitelastmilescore"] && $ver) { + $togo = (int) (($s['siteduration'] - $s["sitelastmilescore"])/60); + echo"<br /><center><h2>Scoreboard (as of $togo minutes to go)</h2></center>\n"; +} else + echo"<br /><center><h2>Final Scoreboard</h2></center>\n"; + +require("$locr/scoretable.php"); +include("$locr/footnote.php"); +?> diff --git a/src/staff/run.php b/src/staff/run.php index e70fd3c..ccfda15 100755 --- a/src/staff/run.php +++ b/src/staff/run.php @@ -54,7 +54,16 @@ if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable" // forca aparecer as runs do proprio site //echo disabled; -// exit; +//exit; +echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('report/stat.php', ". + "'Problem Statistics','width=800,height=600,scrollbars=yes,toolbar=yes,menubar=yes,". + "resizable=yes')\">Statistics</a><br />\n"; +//if($_SESSION['usertable']['username']=='staffnoco999') { +echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('report/score.php?p=0&hor=0', ". + "'Complete Scoreboard','width=800,height=600,scrollbars=yes,toolbar=yes,menubar=yes,". + "resizable=yes')\">Interactive Scoreboard</a><br />\n"; +//} + if (trim($s["sitejudging"])!="") $s["sitejudging"].=",".$_SESSION["usertable"]["usersitenumber"]; else $s["sitejudging"]=$_SESSION["usertable"]["usersitenumber"]; @@ -179,8 +188,8 @@ if ($run[$i]["judge"] != "") { } echo "</table>"; -if (!$anyprinted) echo "<br><center><b><font color=\"#ff0000\">NO RUNS AVAILABLE</font></b></center>"; -else { +//if (!$anyprinted) echo "<br><center><b><font color=\"#ff0000\">NO RUNS AVAILABLE</font></b></center>"; +//else { ?> <br> <script language="javascript"> @@ -191,17 +200,5 @@ else { } </script> </form> -<?php -echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('report/stat.php', ". - "'Problem Statistics','width=800,height=600,scrollbars=yes,toolbar=yes,menubar=yes,". - "resizable=yes')\">Statistics</a><br />\n"; -//if($_SESSION['usertable']['username']=='staffnoco999') { -echo " <a href=\"#\" class=menu style=\"font-weight:bold\" onClick=\"window.open('report/score.php?p=0&hor=0', ". - "'Complete Scoreboard','width=800,height=600,scrollbars=yes,toolbar=yes,menubar=yes,". - "resizable=yes')\">Interactive Scoreboard</a><br />\n"; -//} - -} -?> </body> </html> diff --git a/src/team/problem.php b/src/team/problem.php index 23ade30..6dac4d3 100644 --- a/src/team/problem.php +++ b/src/team/problem.php @@ -20,7 +20,6 @@ require('header.php'); if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) ForceLoad("../index.php"); - ?> <br><b>Information:</b> <?php @@ -31,19 +30,20 @@ if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) <a href="https://global.naquadah.com.br/boca/contest_times.pdf">contest_times.pdf</a> */ -if(is_readable('/var/www/boca/src/pdfwarm19/info_sheet.pdf')) { -?> -<a href="https://global.naquadah.com.br/boca/pdfwarm19/info_sheet.pdf">info_sheet.pdf</a> -<?php -} -if(is_readable('/var/www/boca/src/pdfOLL123/contest_onesided.pdf')) { +if(is_readable('/var/www/boca/src/sample/secretcontest/maratona.pdf')) { ?> - <a href="https://global.naquadah.com.br/boca/pdfOLL123/contest_onesided.pdf">contest.pdf</a> -<?php -} -if(is_readable('/var/www/boca/src/pdfOLL123/contest_times.pdf')) { -?> - <a href="https://global.naquadah.com.br/boca/pdfOLL123/contest_times.pdf">contest_times.pdf</a> +<b>PLAIN FILES:</b> <b>CONTEST</b> ( +<a href='https://global.naquadah.com.br/boca/secretcontest/maratona.pdf'>PT</a> | +<a href='https://global.naquadah.com.br/boca/secretcontest/maratona_es.pdf'>ES</a> | +<a href='https://global.naquadah.com.br/boca/secretcontest/maratona_en.pdf'>EN</a> +) + +<b>Info Sheet</b> ( +<a href='https://global.naquadah.com.br/boca/secretcontest/info_maratona.pdf'>PT</a> | +<a href='https://global.naquadah.com.br/boca/secretcontest/info_maratona_es.pdf'>ES</a> | +<a href='https://global.naquadah.com.br/boca/secretcontest/info_maratona_en.pdf'>EN</a> +) + <?php } ?> @@ -58,7 +58,7 @@ if(is_readable('/var/www/boca/src/pdfOLL123/contest_times.pdf')) { <td><b>Descfile</b></td> </tr> <?php -$prob = DBGetProblems($_SESSION["usertable"]["contestnumber"],false); +$prob = DBGetProblems($_SESSION["usertable"]["contestnumber"]); for ($i=0; $i<count($prob); $i++) { echo " <tr>\n"; // echo " <td nowrap>" . $prob[$i]["number"] . "</td>\n"; @@ -78,7 +78,7 @@ for ($i=0; $i<count($prob); $i++) { echo " </tr>\n"; } echo "</table>"; -if (count($prob) == 0) echo "<br><center><b><font color=\"#ff0000\">NO PROBLEMS AVAILABLE</font></b></center>"; +if (count($prob) == 0) echo "<br><center><b><font color=\"#ff0000\">NO PROBLEMS AVAILABLE YET</font></b></center>"; ?> </body> |