From b3e96dd0a8b12cc78d821612297db8233fb82e5e Mon Sep 17 00:00:00 2001 From: Yohann Date: Fri, 14 Feb 2020 13:17:27 +0100 Subject: [PATCH] =?UTF-8?q?Suivi=20des=20correspondances=20par=20probl?= =?UTF-8?q?=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/.gitignore | 6 ------ .idea/Correspondances.iml | 8 -------- .idea/codeStyles/Project.xml | 9 --------- .idea/codeStyles/codeStyleConfig.xml | 5 ----- .idea/dataSources.xml | 20 ------------------- .idea/deployment.xml | 15 -------------- .idea/misc.xml | 6 ------ .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ dispatcher.php | 1 + .../controllers/suivi_correspondances.php | 14 +++++++++++-- server_files/views/header.php | 6 ++++++ server_files/views/suivi_correspondances.php | 2 +- 14 files changed, 21 insertions(+), 86 deletions(-) create mode 100644 .gitignore delete mode 100644 .idea/.gitignore delete mode 100644 .idea/Correspondances.iml delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/dataSources.xml delete mode 100644 .idea/deployment.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c8935 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 03fd30e..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ - -# Default ignored files -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/Correspondances.iml b/.idea/Correspondances.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/Correspondances.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 8f9a506..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml deleted file mode 100644 index 0be229c..0000000 --- a/.idea/dataSources.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - mysql.8 - true - com.mysql.cj.jdbc.Driver - jdbc:mysql://galaxyoyo.com:3306/corres2math - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml deleted file mode 100644 index f8e28e0..0000000 --- a/.idea/deployment.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 28a804d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a80396f..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/dispatcher.php b/dispatcher.php index e49b87a..b6cf0f3 100644 --- a/dispatcher.php +++ b/dispatcher.php @@ -65,6 +65,7 @@ $ROUTES["^rejoindre-equipe/?$"] = ["server_files/controllers/rejoindre_equipe.ph $ROUTES["^repondre-questions-3$"] = ["server_files/controllers/repondre_questions.php"]; $ROUTES["^repondre-questions-3/([A-Z]{3})$"] = ["server_files/controllers/repondre_questions.php", "trigram"]; $ROUTES["^suivi-correspondances/?$"] = ["server_files/controllers/suivi_correspondances.php"]; +$ROUTES["^suivi-correspondances/([1-4])/?$"] = ["server_files/controllers/suivi_correspondances.php", "problem"]; # Assets files diff --git a/server_files/controllers/suivi_correspondances.php b/server_files/controllers/suivi_correspondances.php index 7d1b5f1..522fabd 100644 --- a/server_files/controllers/suivi_correspondances.php +++ b/server_files/controllers/suivi_correspondances.php @@ -50,8 +50,14 @@ class ValidateVideo $videos = []; -for ($problem = 1; $problem <= 4; ++$problem) - $videos[] = Video::getVideos(Reason::SOLUTION, $problem); +if (!isset($_GET["problem"])) { + for ($problem = 1; $problem <= 4; ++$problem) + $videos[] = Video::getVideos(Reason::SOLUTION, $problem); +} +else { + $videos = [[], [], [], []]; + $videos[intval($_GET["problem"]) - 1] = Video::getVideos(Reason::SOLUTION, intval($_GET["problem"])); +} $waiting_teams = []; $waiting_emails = []; @@ -116,6 +122,8 @@ if (isset($req)) { $team = Team::fromId($data["id"]); if (Phase::getCurrentPhase() >= Phase::PHASE12 && $team->getSolution() == null) continue; + if (isset($_GET["problem"]) && intval($_GET["problem"]) != $team->getProblem()) + continue; $waiting_teams[] = $team; $waiting_emails = array_merge($waiting_emails, $team->getAllEmails()); } @@ -125,6 +133,8 @@ $all_emails = []; foreach (Team::getAllTeams() as $team) { if (Phase::getCurrentPhase() >= Phase::PHASE12 && $team->getSolution() == null) continue; + if (isset($_GET["problem"]) && intval($_GET["problem"]) != $team->getProblem()) + continue; $all_emails = array_merge($all_emails, $team->getAllEmails()); } diff --git a/server_files/views/header.php b/server_files/views/header.php index f10128f..3e5a089 100644 --- a/server_files/views/header.php +++ b/server_files/views/header.php @@ -117,6 +117,12 @@