vale981_fahrschule/templates/quiz.html

74 lines
2.1 KiB
HTML
Raw Normal View History

2014-04-13 20:09:27 +02:00
2014-04-10 20:07:46 +02:00
{% extends 'quizzes.html' %}
<html lang="en">
<head>
<title>Fahrschule Examiner 0.1</title>
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'css/quizz.css' %}" />
</head>
2014-04-13 20:09:27 +02:00
2014-04-10 20:07:46 +02:00
{% block header %}
{% if len >= 20 %}
<div style="font-size: 20px">{{ quiz.title }}</div>
{% else %}
{{quiz.title}}
{% endif %}
{% endblock %}
{% block main %}
2014-04-14 16:29:05 +02:00
{% if quiz.fragen.count == 0 %}
2014-04-10 20:07:46 +02:00
<br>
2014-04-13 10:33:29 +02:00
<h1 id="main_link" style="text-align: center" align="center">Keine Fragen vorhanden!</h1>
2014-04-10 20:07:46 +02:00
{% endif %}
2014-04-18 08:39:11 +02:00
2014-04-14 16:29:05 +02:00
<form action="/quiz/check/" name="quiz_form" method="post">{% csrf_token %}
<input type="hidden" name="user_log" value="{{ user.id }}">
<input type="hidden" name="quiz" value="{{ quiz.id }}">
2014-04-18 08:39:11 +02:00
2014-04-14 16:29:05 +02:00
{% for Frage in quiz.fragen.all %}
2014-04-18 08:39:11 +02:00
<table class="bordered" style="width: 100%"><tr><th colspan="10"><div id="frage">{{Frage.content}}</div></th>
2014-04-14 16:29:05 +02:00
<input type="hidden" name="frage{{ Frage.id }}" value="{{ Frage.id }}">
2014-04-18 08:39:11 +02:00
</tr>
<tr>
2014-04-13 20:09:27 +02:00
{% for aw in Frage.antworten.all %}
2014-04-29 20:27:42 +02:00
<td colspan="3"><label id="checklabel" for="aw_check{{ aw.id }}">
{% if aw.bild == "" %}{% else %}<img src="/media/{{ aw.bild }}" align="center" width="100"><br>{% endif %}
<input align="center" type="checkbox" id="aw_check{{ aw.id }}" name="aw_check{{ aw.id }}" class="aw_check[{{ Frage.id }}][]" />
{% if aw.bild == "" %}{{ aw.content }}{% else %}{% endif %}
</label>
2014-04-18 08:39:11 +02:00
</td>
2014-04-14 16:29:05 +02:00
<input type="hidden" name="antwort{{ Frage.id }}" value="{{ aw.id }}">
2014-04-18 08:39:11 +02:00
2014-04-13 20:09:27 +02:00
{% endfor %}
2014-04-18 08:39:11 +02:00
</tr></table><br>
2014-04-13 20:09:27 +02:00
{% endfor %}
2014-04-18 08:39:11 +02:00
<input type="submit" class="button" value="Abgeben"/>
2014-04-14 16:29:05 +02:00
</form>
2014-04-13 20:09:27 +02:00
2014-04-18 08:39:11 +02:00
2014-04-13 20:09:27 +02:00
2014-04-13 10:33:29 +02:00
2014-04-29 20:27:42 +02:00
<script>$("input:checkbox").click(function() {
if ($(this).is(":checked")) {
var group = "input:checkbox[class='" + $(this).attr("class") + "']";
$(group).prop("checked", false);
$(this).prop("checked", true);
} else {
$(this).prop("checked", false);
}
});</script>
2014-04-10 20:07:46 +02:00
2014-04-29 20:27:42 +02:00
{% endblock %}
2014-04-10 20:07:46 +02:00
</html>
2014-04-13 10:33:29 +02:00