mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-06 04:44:19 +01:00
Add basic quiz functionality
This commit is contained in:
33
tvdt/quiz/templates/quiz/base.html
Normal file
33
tvdt/quiz/templates/quiz/base.html
Normal 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>
|
||||
9
tvdt/quiz/templates/quiz/enter_name.html
Normal file
9
tvdt/quiz/templates/quiz/enter_name.html
Normal 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 %}
|
||||
14
tvdt/quiz/templates/quiz/question.html
Normal file
14
tvdt/quiz/templates/quiz/question.html
Normal 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 %}
|
||||
7
tvdt/quiz/templates/quiz/select_season.html
Normal file
7
tvdt/quiz/templates/quiz/select_season.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user