aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Ribas <brunoribas@gmail.com>2020-11-05 18:27:21 +0000
committerBruno Ribas <brunoribas@gmail.com>2020-11-05 18:27:21 +0000
commit8f0e78886c5d9acb79efb670510125c217ce2049 (patch)
tree12f7a5a4f58f6f9e2a352aa3f3456f5a34d33b00
parentf2ebd9e0c37b461b608fb62ac5b8d14422f830cc (diff)
downloadboca-8f0e78886c5d9acb79efb670510125c217ce2049.tar.gz
boca-8f0e78886c5d9acb79efb670510125c217ce2049.zip
judge/{claredit,header,runchief}.php updates from 2019
Signed-off-by: Bruno Ribas <brunoribas@gmail.com>
-rw-r--r--src/judge/claredit.php4
-rw-r--r--src/judge/header.php12
-rw-r--r--src/judge/runchief.php9
3 files changed, 19 insertions, 6 deletions
diff --git a/src/judge/claredit.php b/src/judge/claredit.php
index a5c3265..fc81d56 100644
--- a/src/judge/claredit.php
+++ b/src/judge/claredit.php
@@ -111,13 +111,13 @@ if (($a = DBGetClarToAnswer($clarnumber, $clarsitenumber,
<tr>
<td width="20%" align=right><b>Clarification:</b></td>
<td width="80%">
- <textarea name="message" readonly cols="60" rows="8"><?php echo unsanitizeText($a["question"]); ?></textarea>
+ <textarea name="message" readonly cols="60" rows="8"><?php echo unsanitizeText($a["question"]); ?></textarea>
</td>
</tr>
<tr>
<td width="20%" align=right><b>Answer:</b></td>
<td width="80%">
- <textarea name="answer" cols="60" rows="8"><?php echo unsanitizeText($a["answer"]); ?></textarea>
+ <textarea name="answer" cols="60" rows="8"><?php echo unsanitizeText($a["answer"]); ?></textarea>
</td>
</tr>
<tr>
diff --git a/src/judge/header.php b/src/judge/header.php
index db2136d..ac5c699 100644
--- a/src/judge/header.php
+++ b/src/judge/header.php
@@ -50,7 +50,11 @@ if($_SESSION["usertable"]["usertype"] != "judge") {
if(($s = DBSiteInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"])) == null)
ForceLoad("../index.php");
-if($s["sitechiefname"]== $_SESSION["usertable"]["username"])
+$isboss=false;
+if($s["sitechiefname"]== $_SESSION["usertable"]["username"] || strpos($_SESSION["usertable"]["username"],'chief')===true)
+ $isboss=true;
+
+if($isboss)
$cc = "338833";
else
$cc = "77cc77";
@@ -69,7 +73,7 @@ echo "</table>\n";
$clar = DBOpenClarsInSites($_SESSION["usertable"]["contestnumber"], $s["sitejudging"]);
$run = DBOpenRunsInSites($_SESSION["usertable"]["contestnumber"], $s["sitejudging"]);
-if($s["sitechiefname"]== $_SESSION["usertable"]["username"]) {
+if($isboss) {
$nrchief = 0;
$rrun = DBAllRunsInSites($_SESSION["usertable"]["contestnumber"], $s["sitejudging"]);
for ($i=0; $i<count($rrun); $i++) {
@@ -82,8 +86,10 @@ $nc=count($clar);
echo "<table border=0 width=\"100%\" align=center>\n";
echo " <tr>\n";
+//echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=problem.php>Problems</a></td>\n";
+
echo " <td align=center width=\"10%\"><a class=menu style=\"font-weight:bold\" href=run.php>Runs ($nr)</a></td>\n";
-if($s["sitechiefname"]== $_SESSION["usertable"]["username"]) {
+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=score.php>Score</a></td>\n";
diff --git a/src/judge/runchief.php b/src/judge/runchief.php
index 7238bed..b124fd8 100644
--- a/src/judge/runchief.php
+++ b/src/judge/runchief.php
@@ -87,8 +87,13 @@ if(isset($_POST)) {
}
}
-
+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";
@@ -160,6 +165,8 @@ for ($i=0; $i<count($run); $i++) {
}
echo " </tr>\n";
}
+}
+}
echo "</table>";
if (count($run) == 0) echo "<br><center><b><font color=\"#ff0000\">NO RUNS AVAILABLE</font></b></center>";