vale981_fahrschule/templates/quiz.html
2014-04-13 20:09:27 +02:00

71 lines
1.9 KiB
HTML

{% 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>
{% block header %}
{% if len >= 20 %}
<div style="font-size: 20px">{{ quiz.title }}</div>
{% else %}
{{quiz.title}}
{% endif %}
{% endblock %}
{% block main %}
{% if Frage.count == 0 %}
<br>
<h1 id="main_link" style="text-align: center" align="center">Keine Fragen vorhanden!</h1>
{% endif %}
<ol>
{% for Frage in Frage %}
<li><div id="frage">{{Frage.content}}</div></li>
{% for aw in Frage.antworten.all %}
<form action="/quiz/check/" name="{{ aw.content }}" method="post">{% csrf_token %}
<label for="aw_check">{{ aw.content }}</label>
<input type="checkbox" name="aw_check" id="aw_check">
<input type="hidden" name="user_log" value="{{ user.id }}">
<input type="hidden" name="frage" value="{{ Frage.id }}">
<input type="hidden" name="antwort" value="{{ aw.id }}">
<input type="hidden" name="quiz" value="{{ quiz.id }}">
{% if aw.richtig %}
<input type="hidden" name="richtig" value=True>
{% else %}
<input type="hidden" name="richtig" value=False>
{% endif %}
<input type="submit" value="Abgeben" />
<br>
</form>
{% endfor %}
{% endfor %}
</ol>
<script language="javascript">
function call_submitforms(){
{% for Frage in Frage %}
{% for aw in Frage.antworten.all %}
setTimeout("document.{{ aw.content }}.submit()",1000);
{{ check.it }}
{% endfor %}
{% endfor %}
}
</script>
<input type="button" value="Abschicken" onclick="call_submitforms()" />
{% endblock %}
</html>