Implement flash messages, refactor candidate retrieval, and enhance quiz functionality

This commit is contained in:
2025-03-04 22:20:35 +01:00
parent 26b99a8353
commit 29bc74fe4f
9 changed files with 88 additions and 17 deletions

View File

@@ -32,6 +32,14 @@
<body>
<main>
<div class="container">
{% for label, messages in app.flashes() %}
{% for message in messages %}
<div class="alert alert-{{ label }} alert-dismissible " role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endfor %}
{% block body %}
{% endblock body %}
</div>

View File

@@ -1,6 +1,9 @@
{% extends "quiz/base.html.twig" %}
{% block body %}
{{ season.name }}
{{ name }}
<h1>Hello World!</h1>
Candiadte: {{ candidate.name }}<br/>
{{ question.question }}<br/>
{% for answer in question.answers %}
<input type="radio" name="answer" value="{{ answer.id }}"> {{ answer.text }}
{% endfor %}
{% endblock body %}