From db20a18b4db6196e7e3ac45193c27cf669551f81 Mon Sep 17 00:00:00 2001 From: brongniart Date: Fri, 10 Jan 2025 09:23:47 +0100 Subject: [PATCH] pull --- config/config.php | 2 +- src/Controleur/UserControler.php | 36 +++++++------------- src/Entity/quizEntity.php | 56 -------------------------------- 3 files changed, 13 insertions(+), 81 deletions(-) delete mode 100644 src/Entity/quizEntity.php diff --git a/config/config.php b/config/config.php index 322a129..c9e012e 100644 --- a/config/config.php +++ b/config/config.php @@ -12,7 +12,7 @@ $base = ''; $login = ''; $mdp = ''; -$racine='/~lebeaulato/WF-Website'; // /~kekentin/WF/WF-Website +$racine='/~kekentin/WF/WF-Website'; // /~kekentin/WF/WF-Website //Vues diff --git a/src/Controleur/UserControler.php b/src/Controleur/UserControler.php index 9a1ad92..3fa8ca9 100644 --- a/src/Controleur/UserControler.php +++ b/src/Controleur/UserControler.php @@ -105,8 +105,7 @@ class UserControler { * @throws RuntimeError * @throws LoaderError */ - public function continueQuiz(int $id_quiz, int $total_questions) : void - { + public function continueQuiz(int $id_quiz, int $total_questions) : void{ global $racine; $score = $_SESSION['score']; $_SESSION['no_question'] = Verification::verifChar( isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1); @@ -123,8 +122,7 @@ class UserControler { * @throws RuntimeError * @throws LoaderError */ - public function endQuiz(int $id_quiz, int $score) : void - { + public function endQuiz(int $id_quiz, int $score) : void{ global $vues,$co; $gw = new QuizGateway($co); @@ -136,8 +134,7 @@ class UserControler { require_once $vues['endQuiz']; } - public function CorrectAnswer() : bool - { + public function CorrectAnswer() : bool{ $answera = Verification::verifChar($_POST['answera'] ?? null); $answerb = Verification::verifChar($_POST['answerb'] ?? null); $answerc = Verification::verifChar($_POST['answerc'] ?? null); @@ -164,8 +161,7 @@ class UserControler { return $answer == $res->getCanswer(); } - public function GetQuestion(int $id): array - { + public function GetQuestion(int $id): array{ global $co; $gw = new QuizQuestionGateway($co); $mdl = new QuizQuestionModel($gw); @@ -177,8 +173,7 @@ class UserControler { * @throws SyntaxError * @throws LoaderError */ - public function showQuestion(int $id, int $num) : void - { + public function showQuestion(int $id, int $num) : void{ global $vues,$twig; $q = $this->GetQuestion($id); $question = $q[$num] ?? $q[0]; @@ -189,8 +184,7 @@ class UserControler { } - public function getNumberOfQuestion(int $id) : int - { + public function getNumberOfQuestion(int $id) : int{ global $co; $gw = new QuizGateway($co); $mdl = new QuizModel($gw); @@ -212,8 +206,7 @@ class UserControler { header("Location:". $racine ."/quote/$id"); } - public function changedata() : void - { + public function changedata() : void{ global $vues, $racine; if ($_POST) { @@ -258,8 +251,7 @@ class UserControler { * @throws RuntimeError * @throws LoaderError */ - public function submit() : void - { + public function submit() : void{ global $vues; require_once $vues['submitQuote']; } @@ -269,8 +261,7 @@ class UserControler { * @throws RuntimeError * @throws LoaderError */ - public function toSubmit() : ?array - { + public function toSubmit() : ?array{ global $co; if ($_POST) { @@ -317,8 +308,7 @@ class UserControler { * @throws RuntimeError * @throws LoaderError */ - public function validsubmit() : void - { + public function validsubmit() : void{ $recap = $this -> toSubmit(); if ($recap) { @@ -331,14 +321,12 @@ class UserControler { * @throws SyntaxError * @throws LoaderError */ - public function recapSubmitQuote(?array $recap) : void - { + public function recapSubmitQuote(?array $recap) : void{ global $twig; echo $twig -> render("recapSubmitQuote.html.twig", ['content' => $recap[0], 'character' => $recap[1], 'source' => $recap[2]]); } - public function getIdOfUser() : ?int - { + public function getIdOfUser() : ?int{ if (isset($_SESSION['user'])) { global $co; diff --git a/src/Entity/quizEntity.php b/src/Entity/quizEntity.php deleted file mode 100644 index e5f31da..0000000 --- a/src/Entity/quizEntity.php +++ /dev/null @@ -1,56 +0,0 @@ -id_quiz = $id_quiz; - $this->nb_questions = $nb_questions; - } - - /** - * @return int - */ - public function getIdQuiz(): int - { - return $this->id_quiz; - } - - /** - * @param int $id_quiz - */ - public function setIdQuiz(int $id_quiz): void - { - $this->id_quiz = $id_quiz; - } - - /** - * @return int - */ - public function getNbQuestions(): int - { - return $this->nb_questions; - } - - /** - * @param int $nb_questions - */ - public function setNbQuestions(int $nb_questions): void - { - $this->nb_questions = $nb_questions; - } - - - - -}