Anthony RICHARD 1 year ago
commit 986e55a3d8

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

@ -36,12 +36,13 @@ class StudentController extends UserController
echo $twig->render('manageVocabView.html', ['vocabularies' => $vocab]);
}
public function memoryChoice(): void {
public function ListVocChoice(): void {
global $twig;
global $user;
$jeu = $_POST['jeu'];
$model = new MdlStudent();
$voc = $model->getAll();
echo $twig->render('vocabList.html', ['vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]);
echo $twig->render('vocabList.html', ['jeu' => $jeu, 'vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]);
}
public function gameChoice(): void {

@ -12,6 +12,7 @@ class VisitorController
{
public function memory($match): void{
global $twig;
global $user;
try{
$idVoc = Validation::filter_int($_POST['idVoc'] ?? 4);
@ -19,6 +20,7 @@ class VisitorController
$name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName();
$wordShuffle = array();
shuffle($wordList);
$pairs = [];
$maxWords = 28;
@ -33,11 +35,22 @@ class VisitorController
shuffle($wordShuffle);
if(isset($user)) {
echo $twig->render('memory.html', [
'wordShuffle' => $wordShuffle,
'pairs' => json_encode($pairs),
'name' => $name,
'userID' => $user->getID(),
'userRole' => $user->getRoles()
]);
}
else{
echo $twig->render('memory.html', [
'wordShuffle' => $wordShuffle,
'pairs' => json_encode($pairs),
'name' => $name
]);
}
}
catch (Exception $e){
@ -47,6 +60,8 @@ class VisitorController
public function quiz($match): void
{
global $twig;
global $user;
try {
$vocabId = Validation::filter_int($_POST['idVoc'] ?? 4);
$vocabList = (new VocabularyListGateway())->findById($vocabId) ?? null;
if ($vocabList == null) throw new Exception("liste inconnue");
@ -80,7 +95,25 @@ class VisitorController
$answers[] = $tab;
}
echo $twig->render('quizView.html', ['questions' => $questions, 'answers' => $answers, 'goodAnswers' => $goodAnswers, 'listName' => $vocabList->getName()]);
if (isset($user)) {
echo $twig->render('quizView.html', [
'questions' => $questions,
'answers' => $answers,
'goodAnswers' => $goodAnswers,
'listName' => $vocabList->getName(),
'userID' => $user->getID(),
'userRole' => $user->getRoles()]);
} else {
echo $twig->render('quizView.html', [
'questions' => $questions,
'answers' => $answers,
'goodAnswers' => $goodAnswers,
'listName' => $vocabList->getName()]);
}
}
catch (Exception $e){
throw new Exception("Erreur");
}
}
public function login(): void {

@ -21,6 +21,8 @@ h1{
gap: 10px;
margin: auto;
perspective: 1000px;
min-width: 70vw;
max-height: 70vh;
}
.card {

@ -11338,6 +11338,7 @@ body {
background-image: url("../assets/img/portrait_black.png");
}
.device[data-device=iPhoneX][data-orientation=portrait][data-color=black] .button {
display: none;
top: 0%;

@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', function () {
var word1;
var word2;
var clickEnabled = true;
var score = 25;
var score = 500;
cards.forEach(function (card) {
card.addEventListener('click', function () {
@ -12,7 +12,6 @@ document.addEventListener('DOMContentLoaded', function () {
return;
}
card.classList.toggle('flipped');
nbCard += 1;
if (nbCard === 1) {
word1 = card.dataset.word;
@ -67,12 +66,11 @@ document.addEventListener('DOMContentLoaded', function () {
(pair[0] === word1 && pair[1] === word2) ||
(pair[0] === word2 && pair[1] === word1)
) {
score+=10;
return true;
}
}
if(score !== 0){
score-=1;
score-=5;
}
return false;
}

@ -5,14 +5,62 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="{{base}}/assets/favicon.ico"/>
<title>Erreur</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Font Awesome icons (free version)-->
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="{{base}}/css/styles.css" rel="stylesheet" />
</head>
<style>
body{
margin-top: 5vh;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #7464a1;
background-image: url("{{base}}/assets/img/nnyc.jpeg");
flex-direction: column;
background-size: cover; /* Ajuster la taille de l'image pour couvrir tout le corps */
background-position: center;
}
.err{
justify-content:center;
color:white;
text-shadow: 0 0 50px black;
}
h1{
display: flex;
justify-content: center;
font-size: 100px;
}
p{
display: flex;
justify-content: center;
font-size: 50px;
}
</style>
<body>
<h1>ERREUR page !!!!!</h1>
<div class="err">
<h1> ERREUR</h1>
{% if dVueEreur is defined %}
{% for value in dVueEreur %}
<p>{{value}}</p>
{% endfor %}
{% endif %}
</div>
</body>
</html>

@ -5,7 +5,6 @@
<title>Users</title>
<link href="{{base}}/css/styles.css" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="{{base}}/assets/favicon.ico"/>
</head>
<style>
body {
margin-top: 5vh;
@ -15,30 +14,39 @@
height: 100vh;
}
.content {
text-align: center;
}
table {
border-spacing: 5%;
margin-top: 20px;
}
</style>
</head>
<body>
{% include 'navBar.twig' %}
{% if vocabularies is defined %}
<div class="content">
<section>
<table>
{% for row in vocabularies %}
<tr>
<td>
<form action="{{base}}/student/{{userID}}/memory" method="post">
<input type="hidden" name="idVoc" value="{{ row.id }}">
<input class="btn-list" type="submit" value="{{ row.name }}" />
<form action="{{base}}/student/{{userID}}/listVocChoice" method="post">
<input type="hidden" name="jeu" value="quiz">
<input class="btn-list" type="submit" value="Quiz" />
</form>
</td>
</tr>
<tr>
<td>
<form action="{{base}}/student/{{userID}}/listVocChoice" method="post">
<input type="hidden" name="jeu" value="memory">
<input class="btn-list" type="submit" value="Memory" />
</form>
</td>
</tr>
{% endfor %}
</table>
</section>
</div>
{% endif %}
</body>
</html>

@ -4,11 +4,13 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Game</title>
<link href="{{base}}/css/styles.css" rel="stylesheet" />
<link rel="stylesheet" href="{{base}}/css/memory.css">
<link rel="icon" type="image/x-icon" href="{{base}}/assets/favicon.ico"/>
</head>
<body>
<div>
{% include 'navBar.twig' %}
<div class="content">
<h1><u>Memory Game:</u> <i>{{ name }}</i></h1>
<div id="memory-game">
{% for word in wordShuffle %}

@ -15,12 +15,11 @@
<li class="nav-item"><a class="nav-link" href="{{ base }}/admin/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %}
{% if 'student' in userRole%}
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/memoryChoice">Memory</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/gameChoice">Play</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %}
{% if 'teacher' in userRole%}
<li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/affAllVocab">Manage lessons</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/game">Play</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %}
{% if userRole is empty %}

@ -13,13 +13,11 @@
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="{{base}}/css/styles.css" rel="stylesheet"/>
<link href="{{base}}/css/quiz.css" rel="stylesheet" />
</head>
<body>
{% include 'navBar.twig' %}
<section id="quiz">
<h1>{{listName}}</h1>
<div id="questionContainer">

@ -12,11 +12,15 @@
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
height: auto;
}
.content {
text-align: center;
}
table {
border-spacing: 5%;
margin-top: 20px;
}
</style>
@ -29,7 +33,7 @@
{% for row in vocabularies %}
<tr>
<td>
<form action="{{base}}/student/{{userID}}/memory" method="post">
<form action="{{base}}/student/{{userID}}/{{jeu}}" method="post">
<input type="hidden" name="idVoc" value="{{ row.id }}">
<input class="btn-list" type="submit" value="{{ row.name }}" />
</form>

Loading…
Cancel
Save