Add basic quiz functionality

This commit is contained in:
2024-11-23 22:25:24 +01:00
parent 6bf0a56b88
commit 27b8c40c1c
40 changed files with 2471 additions and 53 deletions

View File

@@ -0,0 +1,33 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{# <script src="https://cdn.tailwindcss.com"></script>#}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<title>{% block title %}{% endblock %}</title>
<style>
html, body {
height: 100%;
background-image: url("{% static "quiz/background.png" %}");
background-position: center center;
background-repeat: no-repeat;
background-color: black;
display: grid;
align-items: center;
justify-self: center;
color: white;
}
</style>
</head>
<body>
<div class="container">
{% block body %}{% endblock %}
</div>
{% block script %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,9 @@
{% extends "quiz/base.html" %}
{% load crispy_forms_tags %}
{% block body %}
<p>{{ season.name }} ({{ season.season_code }})</p>
{% crispy form %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends 'quiz/base.html' %}
{% load i18n %}
{% block body %}
<h2>{{ question.question }}</h2>
<form method="post">
{% csrf_token %}
{% for answer in question.answers.all %}
<div><button class="btn btn-outline-success" type="submit" name="answer" value="{{ answer.id }}">{{ answer.text }}</button></div>
{% empty %}
{% translate "Weirdly enough this question has no answers..." %}
{% endfor %}
</form>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'quiz/base.html' %}
{% load crispy_forms_tags %}
{% load i18n %}
{% block title %}{% translate "Tijd voor de test" %}{% endblock %}
{% block body %}
{% crispy form %}
{% endblock %}