Lucie GOIGOUX 1 year ago
parent aaf8dc0110
commit a909fc5065

@ -14,7 +14,7 @@ class VisitorController
global $twig; global $twig;
try{ try{
$idVoc = Validation::filter_int($_POST['idVoc'] ?? 2); $idVoc = Validation::filter_int($_POST['idVoc'] ?? 4);
$wordList = (new \gateway\TranslationGateway())->findByIdVoc($idVoc); $wordList = (new \gateway\TranslationGateway())->findByIdVoc($idVoc);
$name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName(); $name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName();
$wordShuffle = array(); $wordShuffle = array();
@ -115,7 +115,9 @@ class VisitorController
public function resultatsJeux($match): void{ public function resultatsJeux($match): void{
global $twig; global $twig;
global $user;
$score = $_POST['score']; $score = $_POST['score'];
echo $twig->render('resultatsJeux.html', ['points' => $score]); if(isset($user)) echo $twig->render('resultatsJeux.html', ['userID' => $user->getId(), 'userRole' => $user->getRoles(), 'points' => $score]);
else echo $twig->render('resultatsJeux.html', ['points'=>$score]);
} }
} }

@ -2995,6 +2995,25 @@ textarea.form-control-lg {
--bs-btn-disabled-border-color: #000; --bs-btn-disabled-border-color: #000;
} }
.btn-list{
background-color: #884288;
color: white;
border: none;
width: 60vw;
height: 20vh;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 10px;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-list:hover {
background-color: #5a0073;
}
.btn-white { .btn-white {
--bs-btn-color: #000; --bs-btn-color: #000;
--bs-btn-bg: #fff; --bs-btn-bg: #fff;

@ -3,23 +3,38 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Users</title> <title>Users</title>
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<link href="{{base}}/css/styles.css" rel="stylesheet" /> <link href="{{base}}/css/styles.css" rel="stylesheet" />
</head> </head>
<style>
body {
margin-top: 5vh;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
table {
border-spacing: 5%;
}
</style>
<body> <body>
{% include 'navBar.twig' %} {% include 'navBar.twig' %}
{% if vocabulary is defined %} {% if vocabularies is defined %}
<div class="content"> <div class="content">
<section> <section>
<table> <table>
<tr> {% for row in vocabularies %}
{% for row in vocabularies %} <tr>
<td><a href="{{base}}/student/{{idStudent}}/memory/{{idVoc}}"> <td>
<input class="btn-black" type="button" value="Show all users"/> <form action="{{base}}/student/{{userID}}/memory" method="post">
</a></td> <input type="hidden" name="idVoc" value="{{ row.id }}">
{% endfor %} <input class="btn-list" type="submit" value="{{ row.name }}" />
</tr> </form>
</td>
</tr>
{% endfor %}
</table> </table>
</section> </section>
</div> </div>

Loading…
Cancel
Save