49 lines
2.0 KiB
HTML
49 lines
2.0 KiB
HTML
{% extends "base.html" %}
|
|
{% load rest_framework %}
|
|
|
|
{% block title %}{{ test.name }} - Edytuj{% endblock %}
|
|
|
|
{% block additional_head %}
|
|
<meta charset="UTF-8">
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="editContainer">
|
|
<form method="post" novalidate>
|
|
<div class="editContainerSection">
|
|
<div class="editContainerLine">
|
|
<label for="name"><h2>Nazwa:</h2></label>
|
|
<input id="name" type="text" name="name" value="{{ test.name }}">
|
|
</div>
|
|
</div>
|
|
{% for question in test.questions.all %}
|
|
<div class="editContainerSection">
|
|
<div class="editContainerLine">
|
|
<label for="desc"><b>Opis:</b></label>
|
|
<input id="desc" type="text" name="desc", value="{{ question.description }}">
|
|
</div>
|
|
{% for answer in question.answers.all %}
|
|
<div class="editContainerLine">
|
|
<label for="ans-{{ forloop.counter }}">Odpowiedź {{ forloop.counter }}: </label>
|
|
<input id="ans-{{ forloop.counter }}" type="text" name="ans-{{ forloop.counter }}", value="{{ answer.description }}">
|
|
</div>
|
|
{% endfor %}
|
|
<div class="editContainerLine">
|
|
<label for="category">Poprawna: </label>
|
|
<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">
|
|
<input type="submit" value="Zapisz test">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|
|
|