pull/25/head
kevin.modejar 4 months ago
parent 198d8d0a48
commit ab176cb06e

@ -142,10 +142,12 @@ class UserControler {
$gw = new QuizGateway($co);
$mdl = new QuizModel($gw);
$nbQuestion = $this->getNumberOfQuestion($id_quiz);
if ($mdl->getQuiz($id_quiz + 1)){
$next = true;
require_once $vues['endQuiz'];
}
$next = false;
require_once $vues['endQuiz'];
}
@ -195,6 +197,7 @@ class UserControler {
$q = $this->GetQuestion($id);
$question = $q[$num] ?? $q[0];
$idquestion = $question->getIdQuestion();
$nbQuestion = $this->getNumberOfQuestion($id);
require_once $vues['quiz'];
//echo $twig->render('quiz.html.twig', ['question' => $question,'id'=>$idquestion]);

@ -12,7 +12,11 @@ echo $twig->render('head.html.twig', [
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
echo $twig->render('endQuiz.html.twig', ['score' => $score, 'nextquiz' => $id_quiz + 1])
echo $twig->render('endQuiz.html.twig',
['score' => $score,
'isNextQuiz' => $next,
'nextquiz' => $id_quiz + 1,
'nb' => $nbQuestion]);
?>

@ -12,6 +12,11 @@ echo $twig->render('head.html.twig', [
// Rendu du bandeau
echo $twig->render('bandeau.html.twig');
echo $twig->render('quiz.html.twig', ['idQuiz'=>$id , 'question' => $question,'id'=>$idquestion]);
echo $twig->render('quiz.html.twig', [
'idQuiz'=>$id ,
'question' => $question,
'id'=>$idquestion,
'nb' => $num + 1,
'nbFinal' => $nbQuestion]);
?>

@ -1,10 +1,13 @@
<h1>Résultat</h1>
<div class="resultat">
<p> nombre de réponse juste : {{ score }}</p>
<p> nombre de réponse fausse : {{ 10 - score }}</p>
<a class="suiv" href="{{racine}}/quiz/{{ nextquiz }}" alt="quiz suivant">
<img src="../images/suivant.png" />
</a>
<p> nombre de réponse fausse : {{ nb - score }}</p>
<p> pourcentage de réusite : {{ (100 * score) / nb }}%<p>
{% if nextquiz %}
<a class="suiv" href="{{racine}}/quiz/{{ nextquiz }}" alt="quiz suivant">
<img src="../images/suivant.png" />
</a>
{% endif %}
</div>
</body>
</html>

@ -26,7 +26,7 @@
</form>
<div class="createQuote">
<a {#href="{{racine}}/submit"#} class="createQuote">Ajouter une citation</a>
<a href="{{racine}}/submit" class="createQuote">Ajouter une citation</a>
</div>

@ -1,7 +1,6 @@
<h1>Quiz</h1>
<div class="quiz">
<h2> {{ question.question }} </h2>
<a id="timer"> 10 seconds left .. </a>
<form id="quizForm" method="POST" >
<div class="answers">
@ -20,6 +19,7 @@
</div>
<input type="hidden" name="action" value="canswer">
</form>
<a id="timer">{{ nb }}/{{ nbFinal }}</a>
</div>
</body>
</html>

Loading…
Cancel
Save