|
|
|
|
@ -49,6 +49,7 @@ class IndexController extends AbstractController
|
|
|
|
|
$session->set('step', $step);
|
|
|
|
|
$form = $this->getForm($test, $step);
|
|
|
|
|
} else {
|
|
|
|
|
$session->set('test_' . $test->getId(), true);
|
|
|
|
|
$session->remove('step');
|
|
|
|
|
$oldUuid = $this->getUuid();
|
|
|
|
|
$this->getUuid(true);
|
|
|
|
|
@ -76,8 +77,7 @@ class IndexController extends AbstractController
|
|
|
|
|
|
|
|
|
|
return $this->render('index/results.html.twig',[
|
|
|
|
|
'test' => $test,
|
|
|
|
|
'correctAnswers' => array_filter($existingAnswers, fn(UserAnswer $a) => $a->isCorrect()),
|
|
|
|
|
'incorrectAnswers' => array_filter($existingAnswers, fn(UserAnswer $a) => !$a->isCorrect()),
|
|
|
|
|
'existingAnswers' => $existingAnswers,
|
|
|
|
|
'service' => $this->questionService,
|
|
|
|
|
'uuid' => $uuid,
|
|
|
|
|
]);
|
|
|
|
|
@ -97,7 +97,7 @@ class IndexController extends AbstractController
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getUuid(bool $forceNew = false)
|
|
|
|
|
private function getUuid($forceNew = false)
|
|
|
|
|
{
|
|
|
|
|
$session = $this->requestStack->getCurrentRequest()->getSession();
|
|
|
|
|
if (!$session->has('uuid') || $forceNew) {
|
|
|
|
|
|