This commit is contained in:
Hubert Jankowski 2022-01-16 23:54:52 +01:00
parent 9b1143aa41
commit 6703406b7e
2 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,5 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load rest_framework %}
{% block title %}{{ test.name }}{% endblock %} {% block title %}{{ test.name }}{% endblock %}
@ -32,8 +33,8 @@
<div class="question_title"> <div class="question_title">
{{ question.description }} {{ question.description }}
</div> </div>
<div class="list-group"> <div class="list-group">
<form method="post" novalidate>
{% for answer in question.answers.all %} {% for answer in question.answers.all %}
<label class="list-group-item"> <label class="list-group-item">
<input class="form-check-input me-1" type="radio" name={{ question.id }} value={{ answer.id }}> <input class="form-check-input me-1" type="radio" name={{ question.id }} value={{ answer.id }}>
@ -45,6 +46,10 @@
{% endfor %} {% endfor %}
</div> </div>
<input class="testContent" type="submit" value="Send answers"> <input class="testContent" type="submit" value="Send answers">
{# <button type="submit" class="testContent" value="Send answers"></button>#}
</form>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -29,6 +29,11 @@ class TestTemplateView(TemplateView):
return context return context
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
import pdb;pdb.set_trace()
question_id = 1 question_id = 1
answers = [] answers = []
while True: while True: