Merge branch 'master' of https://codefirst.iut.uca.fr/git/jade.van_brabandt/3.01-QCM_MuscuMaths
continuous-integration/drone/push Build is passing Details

pull/37/head
Maxence GUITARD 1 year ago
commit 60ac160cca

@ -6,14 +6,14 @@ class Lobby
private int $id;
private string $name;
private string $password;
private int $nbPlayer;
private int $nbPlayers;
public function __construct(int $id, string $name, string $password, int $nbPlayer)
public function __construct(int $id, string $name, string $password, int $nbPlayers)
{
$this->id = $id;
$this->name = $name;
$this->password = $password;
$this->nbPlayer = $nbPlayer;
$this->nbPlayer = $nbPlayers;
}
public function getId(): int
@ -26,12 +26,13 @@ class Lobby
return $this->name;
}
public function getNbPlayer()
public function getNbPlayers()
{
return $this->nbPlayer;
return $this->nbPlayers;
}
public function setNbplayer(int $nbPlayer)
public function setNbplayers(int $nbPlayers)
{
$this->nbPlayer = $nbPlayer;
$this->nbPlayer = $nbPlayers;
}
}

@ -51,21 +51,24 @@ class ControllerAdminAdministrators
function add($param)
{
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
$_SESSION["error"]="Méthode non autorisée.";
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/administrators");
} else {
$username = $_POST['username'];
$password = $_POST['password'];
$username = trim($_POST['username']);
$password = trim($_POST['password']);
if (!isset($username) || !isset($password) || empty($username) || empty($password)) {
$_SESSION["error"]="Veuillez remplir tous les champs.";
$_SESSION["error"] = "Veuillez remplir tous les champs.";
header("Location:/admin/administrators");
} else {
$Admin = [
'username' => $username,
'password' => $password,
];
if ($this->mdAdministrator->verifyAdministratorByName($Admin) != null) {
$_SESSION["error"]="Cet admin existe déjà.";
$_SESSION["error"] = "Cet admin existe déjà.";
header("Location:/admin/administrators");
} else {
$this->mdAdministrator->addAdministrator($Admin);
header("Location:/admin/administrators");
@ -76,28 +79,48 @@ class ControllerAdminAdministrators
function updatemodal($param)
{
$administrator = $this->mdAdministrator->getAdministratorByID($param["id"]);
echo $this->twig->render($this->vues["adminAdministratorsModal"], [
'administrator' => $administrator,
]);
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/administrators");
} else {
$administrator = $this->mdAdministrator->getAdministratorByID($param["id"]) ?? null;
if ($administrator == null) {
$_SESSION["error"] = "Cet admin n'existe pas.";
header("Location:/admin/administrators");
} else {
echo $this->twig->render($this->vues["adminAdministratorsModal"], [
'administrator' => $administrator,
]);
}
}
}
function update($param)
{
$id = $_POST['id'];
$username = $_POST['username'];
$password = $_POST['password'];
$Admin = [
'username' => $username,
'password' => $password,
];
$this->mdAdministrator->updateAdministrator($id, $Admin);
header("Location:/admin/administrators");
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/administrators");
} else {
$id = $_POST['id'];
$username = $_POST['username'];
$password = $_POST['password'];
$username = trim($_POST['username']);
$password = trim($_POST['password']);
if (!isset($username) || !isset($password) || empty($username) || empty($password)) {
$_SESSION["error"] = "Veuillez remplir tous les champs.";
header("Location:/admin/administrators");
} else {
$Admin = [
'username' => $username,
'password' => $password,
];
if ($this->mdAdministrator->verifyAdministratorByName($Admin) != null) {
$_SESSION["error"] = "Cet admin existe déjà.";
} else {
$this->mdAdministrator->updateAdministrator($id, $Admin);
header("Location:/admin/administrators");
}
}
}
}
}

@ -15,69 +15,100 @@ class ControllerAdminChapters
function __construct()
{
global $vues, $twig;
session_start();
try {
if($_SESSION["idAdminConnected"] != null){
$this->twig =$twig;
$this->vues = $vues;
$this->mdChapter = new ModelChapter();
$chapters = $this->mdChapter->getChapters();
echo $twig->render($vues["adminChapters"], [
'chapters' => $chapters,
]);
}
else {
header("Location:/loginAdmin");
}
} catch (PDOException $e) {
// Gérez les erreurs PDO ici
} catch (Exception $e2) {
// Gérez d'autres erreurs ici
global $vues, $twig;
session_start();
try {
if ($_SESSION["idAdminConnected"] != null) {
$this->twig = $twig;
$this->vues = $vues;
$this->mdChapter = new ModelChapter();
$chapters = $this->mdChapter->getChapters();
echo $twig->render($vues["adminChapters"], [
'chapters' => $chapters,
'error' => $_SESSION["error"],
]);
$_SESSION["error"] = null;
} else {
header("Location:/loginAdmin");
}
} catch (PDOException $e) {
// Gérez les erreurs PDO ici
} catch (Exception $e2) {
// Gérez d'autres erreurs ici
}
}
function delete($param) {
function delete($param)
{
$this->mdChapter->deleteChapter($param["id"]);
header("Location:/admin/chapters");
}
function add($param) {
$name = $_POST['name'];
$Chapter = [
'name' => $name,
];
$this->mdChapter->addChapter($Chapter);
header("Location:/admin/chapters");
function add($param)
{
$trimmedName = trim($_POST['name']);
if (isset($_POST['name']) && !empty($_POST['name']) && !empty($trimmedName)) {
$name = $_POST['name'];
$Chapter = [
'name' => $name,
];
$this->mdChapter->addChapter($Chapter);
header("Location:/admin/chapters");
} else {
$_SESSION["error"] = "Veuillez remplir le champ";
header("Location:/admin/chapters");
return;
}
}
function updatemodal($param) {
$chapter = $this->mdChapter->getChapterByID($param["id"]);
echo $this->twig->render($this->vues["adminChaptersModal"], [
'chapter' => $chapter,
]);
function updatemodal($param)
{
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/chapters");
} else {
$chapter = $this->mdChapter->getChapterByID($param["id"]) ?? null;
if ($chapter == null) {
$_SESSION["error"] = "Chapitre introuvable.";
header("Location:/admin/chapters");
} else {
echo $this->twig->render($this->vues["adminChaptersModal"], [
'chapter' => $chapter,
]);
}
}
}
function update($param) {
$id = $_POST['id'];
$name = $_POST['name'];
$Chapter = [
'name' => $name,
];
$this->mdChapter->updateChapter($id,$Chapter);
header("Location:/admin/chapters");
function update($param)
{
var_dump($_SESSION["error"]);
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/chapters");
} else {
$id = $_POST['id'];
$name = $_POST['name'];
$trimmedName = trim($_POST['name']);
if (!isset($name) || empty($name) || empty($trimmedName)) {
$_SESSION["error"] = "Veuillez remplir le champ.";
header("Location:/admin/chapters");
} else {
$chapter = $this->mdChapter->verifyChapterByName($name) ?? null;
if ($chapter != null) {
$_SESSION["error"] = "Ce chapitre existe déjà.";
header("Location:/admin/chapters");
} else {
$Chapter = [
'name' => $name,
];
$this->mdChapter->updateChapter($id, $Chapter);
header("Location:/admin/chapters");
}
}
}
}
}

@ -36,7 +36,9 @@ class ControllerAdminQuestions
echo $twig->render($vues["adminQuestions"], [
'questions' => $questions,
'chapters' => $chapters,
'error' => $_SESSION["error"],
]);
$_SESSION["error"] = null;
} else {
header("Location:/loginAdmin");
}
@ -55,106 +57,147 @@ class ControllerAdminQuestions
function add($param)
{
$content = $_POST['content'];
$idChapter = intval($_POST['idChapter']);
$AnswersPost = array();
$AnswersPost[0] = $_POST['answer1'];
$AnswersPost[1] = $_POST['answer2'];
$AnswersPost[2] = $_POST['answer3'];
$AnswersPost[3] = $_POST['answer4'];
$correctAnswer = intval($_POST['correctAnswer']);
$Question = [
'content' => $content,
'idchapter' => $idChapter,
'idanswergood' => $correctAnswer,
'difficulty' => 1,
'nbfails' => 0,
];
$idquestion = intval($this->mdQuestion->addQuestion($Question));
for ($i = 0; $i <= 3; $i++) {
$Answers[] = [
'content' => $AnswersPost[$i],
'idquestion' => $idquestion,
];
}
$answersId = array();
for ($i = 0; $i <= 3; $i++) {
$answersId[$i] = $this->mdAnswer->addAnswer($Answers[$i]);
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
$_SESSION["error"] = "Méthode non autorisée.";
header("Location:/admin/questions");
} else {
$trimmedContent = trim($_POST['content']);
$trimmedAnswer1 = trim($_POST['answer1']);
$trimmedAnswer2 = trim($_POST['answer2']);
$trimmedAnswer3 = trim($_POST['answer3']);
$trimmedAnswer4 = trim($_POST['answer4']);
if (
isset($_POST['content']) && !empty($_POST['content']) && !empty($trimmedContent)
&& isset($_POST['answer1']) && !empty($_POST['answer1']) && !empty($trimmedAnswer1)
&& isset($_POST['answer2']) && !empty($_POST['answer2']) && !empty($trimmedAnswer2)
&& isset($_POST['answer3']) && !empty($_POST['answer3']) && !empty($trimmedAnswer3)
&& isset($_POST['answer4']) && !empty($_POST['answer4']) && !empty($trimmedAnswer4)
) {
$content = $_POST['content'];
$idChapter = intval($_POST['idChapter']);
$AnswersPost = array();
$AnswersPost[0] = $_POST['answer1'];
$AnswersPost[1] = $_POST['answer2'];
$AnswersPost[2] = $_POST['answer3'];
$AnswersPost[3] = $_POST['answer4'];
$correctAnswer = intval($_POST['correctAnswer']);
$Question = [
'content' => $content,
'idchapter' => $idChapter,
'idanswergood' => $correctAnswer,
'difficulty' => 1,
'nbfails' => 0,
];
$idquestion = intval($this->mdQuestion->addQuestion($Question));
for ($i = 0; $i <= 3; $i++) {
$Answers[] = [
'content' => $AnswersPost[$i],
'idquestion' => $idquestion,
];
}
$answersId = array();
for ($i = 0; $i <= 3; $i++) {
$answersId[$i] = $this->mdAnswer->addAnswer($Answers[$i]);
}
$Question = [
'content' => $content,
'idchapter' => $idChapter,
'difficulty' => 1,
'nbfails' => 0,
'idanswergood' => $answersId[$correctAnswer],
];
$this->mdQuestion->updateQuestion($idquestion, $Question);
header("Location:/admin/questions");
} else {
$_SESSION["error"] = "Veuillez remplir tous les champs";
header("Location:/admin/questions");
}
}
$Question = [
'content' => $content,
'idchapter' => $idChapter,
'difficulty' => 1,
'nbfails' => 0,
'idanswergood' => $answersId[$correctAnswer],
];
$this->mdQuestion->updateQuestion($idquestion, $Question);
header("Location:/admin/questions");
}
function updatemodal($param)
{
$question = $this->mdQuestion->getQuestionByID($param["id"]);
$answers = $this->mdAnswer->getAnswersByIDQuestions($param["id"]);
$question = $this->mdQuestion->getQuestionByID($param["id"]) ?? null;
$answers = $this->mdAnswer->getAnswersByIDQuestions($param["id"]) ?? null;
$chapters = $this->mdChapter->getChapters() ?? null;
$chapters = $this->mdChapter->getChapters();
if ($question == null || $answers == null || $chapters == null) {
$_SESSION["error"] = "Erreur lors de la récupération des données";
header("Location:/admin/questions");
} else {
echo $this->twig->render($this->vues["adminQuestionsModal"], [
'question' => $question,
'chapters' => $chapters,
'answers' => $answers,
]);
echo $this->twig->render($this->vues["adminQuestionsModal"], [
'question' => $question,
'chapters' => $chapters,
'answers' => $answers,
]);
}
}
function update($param)
{
$id = intval($_POST['id']);
$content = $_POST['content'];
$idChapter = intval($_POST['idChapter']);
$correctAnswer = intval($_POST['correctAnswer']);
$answersId = array();
$answersId[0] = intval($_POST['IdAnswer1']);
$answersId[1] = intval($_POST['IdAnswer2']);
$answersId[2] = intval($_POST['IdAnswer3']);
$answersId[3] = intval($_POST['IdAnswer4']);
$answers = array();
$answers[0] = $_POST['answer1'];
$answers[1] = $_POST['answer2'];
$answers[2] = $_POST['answer3'];
$answers[3] = $_POST['answer4'];
$questionDataArray = [
'content' => $content,
'idchapter' => $idChapter,
'idanswergood' => $answersId[$correctAnswer],
];
$this->mdQuestion->updateQuestion($id, $questionDataArray);
for ($i = 0; $i <= 3; $i++) {
$answersDataArray[] = [
'content' => $answers[$i],
'id' => $id,
if (
isset($_POST['content'], $_POST['answer1'], $_POST['answer2'], $_POST['answer3'], $_POST['answer4'], $_POST['idChapter'], $_POST['correctAnswer']) &&
!empty($_POST['content']) && !empty(trim($_POST['content'])) &&
!empty($_POST['answer1']) && !empty(trim($_POST['answer1'])) &&
!empty($_POST['answer2']) && !empty(trim($_POST['answer2'])) &&
!empty($_POST['answer3']) && !empty(trim($_POST['answer3'])) &&
!empty($_POST['answer4']) && !empty(trim($_POST['answer4'])) &&
!empty($_POST['idChapter']) &&
is_numeric($_POST['correctAnswer']) && $_POST['correctAnswer'] >= 0 && $_POST['correctAnswer'] <= 3
) {
$id = intval($_POST['id']);
$content = $_POST['content'];
$idChapter = intval($_POST['idChapter']);
$correctAnswer = intval($_POST['correctAnswer']);
$answersId = array();
$answersId[0] = intval($_POST['IdAnswer1']);
$answersId[1] = intval($_POST['IdAnswer2']);
$answersId[2] = intval($_POST['IdAnswer3']);
$answersId[3] = intval($_POST['IdAnswer4']);
$answers = array();
$answers[0] = $_POST['answer1'];
$answers[1] = $_POST['answer2'];
$answers[2] = $_POST['answer3'];
$answers[3] = $_POST['answer4'];
$questionDataArray = [
'content' => $content,
'idchapter' => $idChapter,
'idanswergood' => $answersId[$correctAnswer],
];
}
for ($i = 0; $i <= 3; $i++) {
$this->mdAnswer->updateAnswer($answersId[$i], $answersDataArray[$i]);
}
$this->mdQuestion->updateQuestion($id, $questionDataArray);
header("Location:/admin/questions");
for ($i = 0; $i <= 3; $i++) {
$answersDataArray[] = [
'content' => $answers[$i],
'id' => $id,
];
}
for ($i = 0; $i <= 3; $i++) {
$this->mdAnswer->updateAnswer($answersId[$i], $answersDataArray[$i]);
}
header("Location:/admin/questions");
} else {
$_SESSION["error"] = "Veuillez remplir tous les champs";
header("Location:/admin/questions");
}
}
}

@ -24,7 +24,6 @@ class ControllerUserLobby
$this->mdLobby = new ModelLobby();
$lobbies = $this->mdLobby->getlobbies();
echo $twig->render($vues["lobby"], [
'lobbies' => $lobbies,

@ -33,7 +33,7 @@ class FrontController
$router->map('GET', '/admin/questions', 'ControllerAdminQuestions');
$router->map('POST', '/admin/questions/[a:action]', 'ControllerAdminQuestions');
$router->map('GET', '/admin/questions/[a:action]/[i:id]', 'ControllerAdminQuestions');
$router->map('GET', '/lobby', 'ControllerUserLobby');
$router->map('GET', '/lobby/list', 'ControllerUserLobby');
$router->map('POST', '/user/players/[a:action]', 'ControllerUserPlayers');
$router->map('GET', '/user/players/[a:action]/[i:id]', 'ControllerUserPlayers');

@ -62,7 +62,7 @@ class GatewayChapter
$this->con->executeQuery($query, array(':id' => array($id, PDO::PARAM_INT)));
}
public function verifyChapter($id)
public function verifyChapterByID($id)
{
$query = "SELECT chapters.id FROM chapters WHERE id = :id;";
$this->con->executeQuery(
@ -74,4 +74,17 @@ class GatewayChapter
$results = $this->con->getResults();
return $results[0];
}
public function verifyChapterByName($name)
{
$query = "SELECT * FROM chapters WHERE name = :name;";
$this->con->executeQuery(
$query,
array(
':name' => array($name, PDO::PARAM_STR)
)
);
$results = $this->con->getResults();
return $results[0];
}
}

@ -31,12 +31,10 @@ class GatewayLobby
public function getLobbies()
{
$query = "SELECT * FROM Lobbies;";
$query = "SELECT * FROM lobbies;";
$this->con->executeQuery($query);
$results = $this->con->getResults();
if ($results == NULL) {
return false;
}
return $results;
}

@ -22,8 +22,12 @@ class ModelAdministrator
public function getAdministratorByID($id)
{
$administratorDataArray = $this->gwAdministrator->getAdministratorByID($id);
$administrator = new Administrator($administratorDataArray["id"],$administratorDataArray["username"], $administratorDataArray["password"]);
return $administrator;
if ($administratorDataArray == null) {
return null;
} else {
$administrator = new Administrator($administratorDataArray["id"], $administratorDataArray["username"], $administratorDataArray["password"]);
return $administrator;
}
}
public function getAdministrators()
@ -31,7 +35,7 @@ class ModelAdministrator
$administratorsDataArray = $this->gwAdministrator->getAdministrators();
$administrators = array();
foreach ($administratorsDataArray as $administratorDataArray) {
$administrator = new Administrator($administratorDataArray["id"],$administratorDataArray["username"], $administratorDataArray["password"]);
$administrator = new Administrator($administratorDataArray["id"], $administratorDataArray["username"], $administratorDataArray["password"]);
$administrators[] = $administrator;
}
return $administrators;

@ -30,12 +30,16 @@ class ModelAnswer
function getAnswersByIDQuestions($idQuestion)
{
$answersDataArray = $this->gwAnswer->getAnswersByIDQuestions($idQuestion);
$answers = array();
foreach ($answersDataArray as $answerDataArray) {
$answer = new Answer($answerDataArray['id'], $answerDataArray['content'], $idQuestion);
$answers[] = $answer;
if ($answersDataArray == null) {
return null;
} else {
$answers = array();
foreach ($answersDataArray as $answerDataArray) {
$answer = new Answer($answerDataArray['id'], $answerDataArray['content'], $idQuestion);
$answers[] = $answer;
}
return $answers;
}
return $answers;
}
function updateAnswer($answersId, $answer)

@ -17,12 +17,16 @@ class ModelChapter
function getChapters()
{
$chaptersDataArray = $this->gwChapter->getChapters();
$chapters = array();
foreach ($chaptersDataArray as $chapterDataArray) {
$chapter = new Chapter($chapterDataArray['id'],$chapterDataArray["name"]);
$chapters[] = $chapter;
if ($chaptersDataArray == null) {
return null;
} else {
$chapters = array();
foreach ($chaptersDataArray as $chapterDataArray) {
$chapter = new Chapter($chapterDataArray['id'], $chapterDataArray["name"]);
$chapters[] = $chapter;
}
return $chapters;
}
return $chapters;
}
function deleteChapter($id)
@ -38,8 +42,12 @@ class ModelChapter
function getChapterByID($id)
{
$chapterDataArray = $this->gwChapter->getChapterByID($id);
$chapter = new Chapter($chapterDataArray['id'],$chapterDataArray['name']);
return $chapter;
if ($chapterDataArray == null) {
return null;
} else {
$chapter = new Chapter($chapterDataArray['id'], $chapterDataArray['name']);
return $chapter;
}
}
function updateChapter($id, $chapter)
@ -48,7 +56,15 @@ class ModelChapter
}
public function verifyChapter($chapter)
{
$id = $this->gwChapter->verifyChapter($chapter);
$id = $this->gwChapter->verifyChapterByID($chapter);
return $id;
}
public function verifyChapterByName($name)
{
$id = $this->gwChapter->verifyChapterByName($name);
if ($id == null) {
return null;
}
return $id;
}
}

@ -23,15 +23,17 @@ class ModelLobby
{
$lobbiesDataArray = $this->gwLobby->getLobbies();
$lobbies = array();
foreach ($lobbiesDataArray as $lobbyDataArray) {
$lobby = new Lobby(
intval($lobbyDataArray['id']),
$lobbyDataArray['name'],
$lobbyDataArray['password'],
intval($lobbyDataArray['nbPlayer'])
intval($lobbyDataArray['nbplayers'])
);
$lobbies[] = $lobby;
return $lobbies;
}
return $lobbies; // Move the return statement outside the foreach loop
}
}

@ -15,7 +15,7 @@ class ModelQuestion
$this->gwQuestion = new GatewayQuestion();
}
function getQuestions() : array
function getQuestions(): array
{
$questionsDataArray = $this->gwQuestion->getQuestions();
$questions = array();
@ -50,15 +50,19 @@ class ModelQuestion
function getQuestionByID($id)
{
$questionDataArray = $this->gwQuestion->getQuestionByID($id);
$question = new Question(
intval($questionDataArray['id']),
$questionDataArray['content'],
intval($questionDataArray['idchapter']),
intval($questionDataArray['idanswergood']),
intval($questionDataArray['difficulty']),
intval($questionDataArray['nbfails'])
);
return $question;
if ($questionDataArray == null) {
return null;
} else {
$question = new Question(
intval($questionDataArray['id']),
$questionDataArray['content'],
intval($questionDataArray['idchapter']),
intval($questionDataArray['idanswergood']),
intval($questionDataArray['difficulty']),
intval($questionDataArray['nbfails'])
);
return $question;
}
}
function updateQuestion($id, $questionDataArray)

@ -2,14 +2,14 @@
<html lang="fr">
<head>
<meta charset=utf-8>
<meta charset="UTF-8">
<title>Math'Educ</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body style="color:white;">
<body id="bodyStyle">
<div class="container-fluid text-center pt-5" style="height:85vh;">
<form class="row g-3 needs-validation w-100" action="traitementAjout.php" method="post" novalidate>
<div class="container fs-2">

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
@ -15,7 +15,8 @@
</a>
</div>
<div class="container mt-5 text-light fs-4">
<h1>Liste des administrators</h1>
<h1>Liste des administrators</h1>
<p class="text-center bg-danger"> {{ error }} </p>
<ul class="list-group">
{% for admin in administrators %}
<li class="list-group-item d-flex justify-content-between align-items-center border-dark text-light bg-secondary">

@ -1,15 +1,14 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../../../css/global.css">
</head>
<body>
<body id="bodyStyle">
<div class="modal fade" id="modalUpdateAdministrators">
<div class="modal-dialog" role="document">
<div class="modal-content">

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
@ -17,6 +17,7 @@
</div>
<div class="container mt-5 text-light fs-4">
<h1>Liste des chapitres</h1>
<p class="text-center bg-danger"> {{ error }} </p>
<ul class="list-group">
{% for chapter in chapters %}
<li class="list-group-item d-flex justify-content-between align-items-center border-dark text-light bg-secondary">

@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../../../css/global.css">
</head>
<body>
<body id="bodyStyle">
<div class="modal fade" id="modalUpdateChapters">
<div class="modal-dialog" role="document">
<div class="modal-content">

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
@ -17,6 +17,7 @@
</div>
<div class="container mt-5 text-light fs-4">
<h1>Liste des questions</h1>
<p class="text-center bg-danger"> {{ error }} </p>
<ul class="list-group">
{% for question in questions %}
<li class="list-group-item d-flex justify-content-between align-items-center border-dark text-light bg-secondary">
@ -31,7 +32,7 @@
</div>
<div class="container mt-3 d-flex justify-content-between">
<a type="button" href="/admin/chapters" class="btn btn-secondary fs-5"> ← Chapitres</a>
<button type="button" class="btn btn-primary fs-5" data-bs-toggle="modal" data-bs-target="#modalquestions">Ajouter un chapitre</button>
<button type="button" class="btn btn-primary fs-5" data-bs-toggle="modal" data-bs-target="#modalquestions">Ajouter une question</button>
<a type="button" href="/admin/administrators" class="btn btn-secondary fs-5">Administrateurs →</a>
</div>

@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</script>
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../../../css/global.css">
</head>
<body>
<body id="bodyStyle">
<div class="modal fade" id="modalUpdateQuestions">
<div class="modal-dialog" role="document">
<div class="modal-content">

@ -2,9 +2,9 @@
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Maths'Educ</title>
<title>Math'Educ</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body id="bodyStyle">
<div class="fs-1 text-light text-center mt-5">

@ -3,9 +3,9 @@
<head>
<meta charset=utf-8>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body id="bodyStyle">
@ -29,7 +29,7 @@
</h1>
</div>
</a>
<a href="/lobby" class="text-white m-3 container text-center d-flex align-items-center w-75 rounded border border-white text-center" style="background-color:orange;text-decoration: none;color: black;height:20vh;">
<a href="/lobby/list" class="text-white m-3 container text-center d-flex align-items-center w-75 rounded border border-white text-center" style="background-color:orange;text-decoration: none;color: black;height:20vh;">
<div class="container text-center d-flex align-items-center text-center">
<h1 class="mx-auto fs-1">
MULTIJOUEUR

@ -2,7 +2,7 @@
<html lang="fr">
<head>
<meta charset=utf-8>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="/css/global.css">
</head>
@ -26,7 +26,7 @@
{% for lobby in lobbies %}
<li class="list-group-item d-flex justify-content-between align-items-center">
<h6>{{lobby.name}}</h6>
<h6>{{lobby.nbPlayer}}/6</h6>
<h6>0/{{lobby.nbPlayer}}</h6>
<div class="btn">
<a type="button" class="btn btn-primary" href="">Rejoindre</a>
</div>
@ -37,40 +37,5 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<div class="modal fade" id="modalquestions">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ajouter une question</h5>
</div>
<form method="POST" action="/admin/questions/add">
<div class="modal-body">
<div class="form-group">
<label for="name">Contenu de la question :</label>
<input type="text" class="form-control" id="content" name="content">
</div>
<div class="form-group">
<label for="name">Chapitre de la question :</label>
<select class="form-control" id="idChapter" name="idChapter">
{% for chapter in chapters %}
<option value="{{chapter.id}}" >{{chapter.name}}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="name">Réponse 1 de la question :</label>
<input type="text" class="form-control" id="answer1" name="answer1">
<input type="radio" name="correctAnswer" checked="checked" value="0"> Correct
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
<button type="submit" class="btn btn-primary">Enregistrer</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>

@ -2,9 +2,9 @@
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Maths'Educ - Connexion</title>
<title>Math'Educ - Connexion</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body id="bodyStyle">
<div>

@ -2,9 +2,9 @@
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Maths'Educ - Connexion</title>
<title>Math'Educ - Connexion</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body id="bodyStyle">
<div>

@ -3,8 +3,8 @@
<head>
<meta charset=utf-8>
<title>Maths'Educ</title>
<link rel="stylesheet" href="css/global.css">
<title>Math'Educ</title>
<link rel="stylesheet" href="../css/global.css">
<link rel="stylesheet" href="css/chrono.css">
<link rel="stylesheet" href="css/progressBar.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

@ -3,8 +3,8 @@
<head>
<meta charset=utf-8>
<title>Maths'Educ</title>
<link rel="stylesheet" href="css/global.css">
<title>Math'Educ</title>
<link rel="stylesheet" href="../css/global.css">
<link rel="stylesheet" href="css/chrono.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../../../css/global.css">
</head>
<body>
<body id="bodyStyle">
<div class="modal fade" id="modalUpdateAdministrators">
<div class="modal-dialog" role="document">
<div class="modal-content">

@ -1,11 +1,11 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Maths Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
</head>
<body id="bodyStyle">

@ -2,9 +2,9 @@
<html lang="fr">
<head>
<title>Maths'Educ</title>
<title>Math'Educ</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="../css/global.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/confetti.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

Loading…
Cancel
Save