fix : Everything is beautifull :flower:
continuous-integration/drone/push Build is passing Details

pull/35/head
Jade VAN BRABANDT 1 year ago
parent ff94851391
commit 225cad5fe4

@ -111,7 +111,6 @@ class ControllerUser
$answers = $this->mdAnswer->getAnswersByIDQuestions($question->getId());
$_SESSION["Answers"][] = $answers;
}
var_dump($_SESSION["Questions"]);
echo $this->twig->render($this->vues["singleplayer"], [
'questions' => $_SESSION["Questions"],
'numQuestion' => 0,
@ -153,16 +152,30 @@ class ControllerUser
'answerss' => $_SESSION["Answers"],
]);
} else {
$goodAnswer = array();
$Final = array();
$Final[]["Question"] = array();
$Final[]["goodAnswer"] = array();
$Final[]["PlayerAnswer"] = array();
$c=0;
foreach ($_SESSION["Questions"] as &$question) {
$answer = $this->mdAnswer->getAnswerByID($question->getIdAnswerGood());
$goodAnswer[] = $answer->getContent();
$Final[$c]["goodAnswer"] = $answer->getContent();
$c=$c+1;
}
$c=0;
foreach ($_SESSION["Questions"] as $question) {
$Final[$c]["Question"] = $question->getContent();
$c=$c+1;
}
$c=0;
foreach ($_SESSION["playerAnswersContent"] as $answer)
{
$Final[$c]["PlayerAnswer"] = $answer;
$c=$c+1;
}
echo $this->twig->render($this->vues["viewScore"], [
'score' => $_SESSION["Score"],
'questions' => $_SESSION["Questions"],
'answerss' => $_SESSION["Answers"],
'goodAnswer' => $goodAnswer,
'Final' => $Final,
]);
}
}

@ -76,7 +76,6 @@ class ModelQuestion
);
$this->questions[] = $question;
}
return $this->questions;
}
}

@ -17,15 +17,15 @@
</div>
<div class="d-flex flex-column align-items-center text-light fs-3">
{% for question in questions %}
{% for f in Final %}
<p>
Question : {{ question['content'] }}
Question : {{ f['Question'] }}
</p>
<p>
Bonne réponse : {{ goodAnswer['goodAnswersContent'] }}
Bonne réponse : {{ f['goodAnswer'] }}
</p>
<p>
Votre réponse : {{ question['playerAnswersContent'] }}
Votre réponse : {{ f['PlayerAnswer'] }}
</p>
{% endfor %}

Loading…
Cancel
Save