SOITA/templates/editTest.html

49 lines
2.0 KiB
HTML
Raw Normal View History

2022-01-21 18:34:46 +01:00
{% extends "base.html" %}
{% load rest_framework %}
2022-01-25 18:17:58 +01:00
{% block title %}{{ test.name }} - Edytuj{% endblock %}
2022-01-21 18:34:46 +01:00
{% block additional_head %}
<meta charset="UTF-8">
{% endblock %}
{% block content %}
<div class="editContainer">
<form method="post" novalidate>
<div class="editContainerSection">
<div class="editContainerLine">
2022-01-25 18:17:58 +01:00
<label for="name"><h2>Nazwa:</h2></label>
<input id="name" type="text" name="name" value="{{ test.name }}">
2022-01-21 18:34:46 +01:00
</div>
</div>
{% for question in test.questions.all %}
<div class="editContainerSection">
<div class="editContainerLine">
2022-01-25 18:17:58 +01:00
<label for="desc"><b>Opis:</b></label>
2022-01-21 18:34:46 +01:00
<input id="desc" type="text" name="desc", value="{{ question.description }}">
</div>
{% for answer in question.answers.all %}
<div class="editContainerLine">
2022-01-25 18:17:58 +01:00
<label for="ans-{{ forloop.counter }}">Odpowiedź {{ forloop.counter }}: </label>
2022-01-21 18:34:46 +01:00
<input id="ans-{{ forloop.counter }}" type="text" name="ans-{{ forloop.counter }}", value="{{ answer.description }}">
</div>
{% endfor %}
<div class="editContainerLine">
2022-01-25 18:17:58 +01:00
<label for="category">Poprawna: </label>
2022-01-21 18:34:46 +01:00
<select name="category" id="category">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
</div>
{% endfor %}
<div class="testContent">
2022-01-25 18:17:58 +01:00
<input type="submit" value="Zapisz test">
2022-01-21 18:34:46 +01:00
</div>
</form>
</div>
{% endblock %}