From b2bdc6350f947a2621d967488e5f8b85868f0c5b Mon Sep 17 00:00:00 2001 From: antux18 Date: Tue, 13 Feb 2024 10:36:59 +0100 Subject: [PATCH] =?UTF-8?q?Suppression=20de=20la=20fonction=20d'=C3=A9nigm?= =?UTF-8?q?e=20bonus=20+=20changement=20du=20nom=20de=20l'app.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- answer.php | 11 ----------- article.php | 12 ------------ data/article.db | Bin 40960 -> 40960 bytes data/teams.db | Bin 45056 -> 45056 bytes puzzles.php | 15 +-------------- require/database.php | 7 ------- require/locales/en.php | 14 +++++++------- require/locales/fr.php | 16 ++++++++-------- 8 files changed, 16 insertions(+), 59 deletions(-) diff --git a/answer.php b/answer.php index 00aab09..2d328bc 100644 --- a/answer.php +++ b/answer.php @@ -56,17 +56,6 @@ $stmt->bindValue(":puzzle_id", $art_id); $stmt->bindValue(":team_id", $team_id); $stmt->execute(); - - // On ajoute l'énigme bonus si toutes les autres sont résolues : - $stmt = $database->pdo_teams->prepare("SELECT COUNT(*) FROM solved WHERE team_id == :team_id"); - $stmt->bindValue(":team_id", $team_id); - $stmt->execute(); - - if ($stmt->fetchAll()[0]["COUNT(*)"] == "12") { // Il y a 12 énigmes sans compter la bonus - $stmt = $database->pdo_teams->prepare("UPDATE teams SET bonus = 1 WHERE id = :team_id"); - $stmt->bindValue(":team_id", $team_id); - $stmt->execute(); - } } $data["valid_qr"] = true; diff --git a/article.php b/article.php index 95783fe..8483a34 100644 --- a/article.php +++ b/article.php @@ -27,18 +27,6 @@ } else { - // On vérifie si l'énigme bonus n'est pas débloquée : - if (!$database->checkTeamBonus($team_id)) { - // Si c'est celle qui est sélectionnée, on retourne à la liste des énigmes : - if ($art_id == $max_art) { - header("Location: puzzles.php?team=" . $team_id); - die(); - } - - // On retire l'énigme bonus du total : - $max_art--; - } - // On indique si l'énigme est résolue : $stmt = $database->pdo_teams->prepare("SELECT * FROM solved WHERE (team_id == :team_id AND puzzle_id == :puzzle_id)"); $stmt->bindValue(":team_id", $team_id); diff --git a/data/article.db b/data/article.db index 10f51c9174599e637426cf55f2adf262c490aad0..428531b4db56fb523ec40499ecb20c2dd91921bc 100644 GIT binary patch delta 59 zcmV-B0L1@*zyg540+1U47Lgo71r`7&r1+xV} RoCE>{7qNj81hckCN>?d35-$J% delta 640 zcmYL{zityj5XN&34ieH48j}Jf<^jwh-~|u{DUQOwM1i!MyYXdVZ}-^QwTv4Z0ew)a zNEGR?3yR2y0tzDCn^5u;%&sHRoV2&!%>2G@c6#2Lp0|!}B%RMUd+p9jHu!s1oZebZ z*S{|=!?*Rd_G*%(>Eh>|t!v5JqW$2@rB?F$?ESA~@^LS{va<21BRJGnOY;>8on!XIXvapm_l)3Bc*o?o8H5;vjRm>T zP97iaTz%7=UZ5^Xjl4)VGKX5Wt(|fvZrODtir%6DJ3FNIaOvw8#WDF;yT;R}1%Mx$Fg-ij1i4ovP@B^T% Ozq`5LU;NnIdi4)lwevXu diff --git a/data/teams.db b/data/teams.db index 27d92d3153fce3188cfb391d4913638c9c85c012..4bcc5551541bce928fdffd3f7bf6ff993f366d9c 100644 GIT binary patch delta 243 zcmZp8z|`=7X@az%9|HpeHxRP}F)I+uP1G@#_G8e?y1>i(j)9f8g_-Xoe;RKKA3NVM zzG}Ye&4vP8ypvmavsn1586+n`2X<#*nCm`4L>^*6B7dyBh%*p z`j7Z0P7vYdWM>v<1e?YLRG=@g`GNcmenA$Xfm}cgayJ_gvjXK_@biF#nE1bejQa)@ VdBxAg%FM{f#Kg?Z$+@V(001e4J9q#9 delta 652 zcmZp8z|`=7X@az%F9QPuHxRP}F)I*DPt-A%^kvXXd&SFF&A`gr!oc^DKaKYt-!a}6 zUfzw3bv!J5`xsj%ItsG@D>j8G!^B%twFtzwy4I6Lh7DML-{!@G>!pY;0s>QetIhWMpDu kX6EDsdI$tqfS3b_nSmJON$$;z4lm><32 diff --git a/puzzles.php b/puzzles.php index de4076a..a88c400 100644 --- a/puzzles.php +++ b/puzzles.php @@ -31,20 +31,7 @@ false ); - // On vérifie si l'équipe a débloqué l'énigme bonus : - $stmt = $database->pdo_teams->prepare("SELECT * FROM teams WHERE id = :id"); - $stmt->bindValue(":id", $team_id); - $stmt->execute(); - - // Si c'est le cas, on affiche toutes les énigmes : - if ($stmt->fetchAll()[0][1] == 1) { - $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles"); - } - - // Sinon, on cache la bonus : - else { - $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles WHERE id <> 13"); - } + $stmt = $database->pdo_article->prepare("SELECT * FROM puzzles"); $stmt->execute(); $puzzles = $stmt->fetchAll(); diff --git a/require/database.php b/require/database.php index aa04737..fe69edf 100644 --- a/require/database.php +++ b/require/database.php @@ -24,7 +24,6 @@ $this->pdo_teams = new PDO("sqlite:" . dirname(__FILE__) . $data_path . "teams.db"); $this->pdo_teams->query('CREATE TABLE IF NOT EXISTS "teams" ( "id" INTEGER NOT NULL UNIQUE, - "bonus" INTEGER NOT NULL, PRIMARY KEY("id" AUTOINCREMENT) )'); @@ -57,12 +56,6 @@ return $query->fetch()["COUNT(*)"]; } - function checkTeamBonus(int $team) { - // $team doit être une équipe existante : - $query = $this->pdo_teams->query("SELECT bonus FROM teams WHERE id = " . $team); - return $query->fetch()[0] == 1; - } - // public function getTeamsNb() { // $query = $this->pdo_teams->query("SELECT COUNT(*) FROM teams"); // return $query->fetch()["COUNT(*)"]; diff --git a/require/locales/en.php b/require/locales/en.php index 61bc898..a9e71f7 100644 --- a/require/locales/en.php +++ b/require/locales/en.php @@ -1,19 +1,19 @@ [ - "home" => "Home - Lycée Pange Code Hunt", - "team_confirm" => "Team confirmation - Lycée Pange Code Hunt", - "puzzles" => "Puzzles list - Lycée Pange Code Hunt", - "article" => "Puzzle - Lycée Pange Code Hunt" + "home" => "Home - Citizenship Code Hunt", + "team_confirm" => "Team confirmation - Citizenship Code Hunt", + "puzzles" => "Puzzles list - Citizenship Code Hunt", + "article" => "Puzzle - Citizenship Code Hunt" ], "page_title" => [ - "home" => "Code Hunt", + "home" => "Citizenship Code Hunt", "team_confirm" => "Team confirmation", "puzzles" => "Puzzles list for team n°", "article" => "Puzzle n°" ], "home" => [ - "subtitle" => "Welcome to the code hunt of Lycée Jean de Pange of Sarreguemines !", + "subtitle" => "Welcome to the Citizenship Code Hunt !", "message" => "Enter your team number to begin :", "team" => "Team number...", "button" => "OK" @@ -38,7 +38,7 @@ "map_desc" => "Here is a map showing the location of the puzzles you already solved :" ], "nav" => [ - "title" => "Code Hunt Pange", + "title" => "Citizenship Code Hunt", "home" => "Home" ], "footer" => [ diff --git a/require/locales/fr.php b/require/locales/fr.php index 3433df2..9494eaf 100644 --- a/require/locales/fr.php +++ b/require/locales/fr.php @@ -1,19 +1,19 @@ [ - "home" => "Accueil - Chasse au code Lycée Pange", - "team_confirm" => "Confirmation du choix d'équipe - Chasse au code Lycée Pange", - "puzzles" => "Liste des énigmes - Chasse au code Lycée Pange", - "article" => "Énigme - Chasse au code Lycée Pange" + "home" => "Accueil - Jeu de Pistes de la Citoyenneté", + "team_confirm" => "Confirmation du choix d'équipe - Jeu de Pistes de la Citoyenneté", + "puzzles" => "Liste des énigmes - Jeu de Pistes de la Citoyenneté", + "article" => "Énigme - Jeu de Pistes de la Citoyenneté" ], "page_title" => [ - "home" => "Chasse au code", + "home" => "Jeu de Pistes de la Citoyenneté", "team_confirm" => "Confirmation du choix d'équipe", "puzzles" => "Liste des puzzles pour l'équipe n°", "article" => "Énigme n°" ], "home" => [ - "subtitle" => "Bienvenue à la chasse au code du Lycée Jean de Pange de Sarreguemines !", + "subtitle" => "Bienvenue dans le Jeu de Pistes de la Citoyenneté !", "message" => "Pour commencer, veuillez entrer le numéro de votre équipe :", "team" => "Numéro d'équipe...", "button" => "Valider" @@ -38,11 +38,11 @@ "map_desc" => "Voici la carte des emplacements des énigmes que vous avez résolues :" ], "nav" => [ - "title" => "Chasse au code Pange", + "title" => "Jeu de Pistes de la Citoyenneté", "home" => "Accueil" ], "footer" => [ - "text" => "Lycée Jean de Pange Sarreguemines
Code source" + "text" => "Lycée Jean de Pange Sarreguemines
Code source" ] ]; ?> \ No newline at end of file