2022-01-30 20:04:27 +01:00
|
|
|
{# <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>#}
|
|
|
|
|
|
|
|
|
|
|
|
{#{% 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>#}
|
|
|
|
{##}
|
|
|
|
{# {% 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">#}
|
|
|
|
{# <a href="/tests/{{test.id}}/add-question">Dodaj pytanie</a>#}
|
|
|
|
{# <a href="/tests/{{test.id}}/remove-question">Usun pytanie</a>#}
|
|
|
|
{# </div>#}
|
|
|
|
{# </form>#}
|
|
|
|
{# </div>#}
|
|
|
|
{#{% endblock %}#}
|
|
|
|
{##}
|
|
|
|
|
|
|
|
|
2022-01-21 18:34:46 +01:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% load rest_framework %}
|
|
|
|
|
2022-01-30 20:04:27 +01:00
|
|
|
{% block title %}{{ test.name }}{% endblock %}
|
2022-01-21 18:34:46 +01:00
|
|
|
|
|
|
|
{% block additional_head %}
|
|
|
|
<meta charset="UTF-8">
|
2022-01-30 20:04:27 +01:00
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
|
|
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.test_title {
|
|
|
|
font-size: 40px;
|
|
|
|
}
|
|
|
|
.test_body {
|
|
|
|
width: 50%;
|
|
|
|
}
|
|
|
|
.question_title {
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
2022-01-21 18:34:46 +01:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2022-01-30 20:04:27 +01:00
|
|
|
<div class="card" style="border: none;">
|
|
|
|
<div class="card-body test_body">
|
2022-01-21 18:34:46 +01:00
|
|
|
<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-30 20:04:27 +01:00
|
|
|
<button class="defaultButton">
|
|
|
|
<a href='' onclick="this.href='editName?name='+document.getElementById('name').value">Zmien nazwe</a>
|
|
|
|
</button>
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
2022-04-09 13:02:21 +02:00
|
|
|
<label for="actual_visible">Aktualna widzialność: {% if test.visible %}Publiczny{% else %}Prywatny{% endif %}</label><br>
|
|
|
|
<label for="visible">Widzialność: </label>
|
|
|
|
<select name="visible" id="visible">
|
|
|
|
<option value="public">Publiczny</option>
|
|
|
|
<option value="private">Prywatny</option>
|
|
|
|
</select>
|
|
|
|
<button class="defaultButton">
|
|
|
|
<a href='' onclick="this.href='editVisible?visible='+document.getElementById('visible').value">Zmien widzialność testu</a>
|
|
|
|
</button>
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
2022-01-30 20:04:27 +01:00
|
|
|
<form method="post" novalidate>
|
|
|
|
{% for question in test.questions.all %}
|
|
|
|
<div class="question_title" style="padding-top:15px; padding-bottom:10px; padding-left:5px;">
|
|
|
|
{{ question.description }}
|
|
|
|
<input class="form-check-input me-1" type="radio" name="id" value={{ question.id }}>
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
2022-01-30 20:04:27 +01:00
|
|
|
<div class="list-group">
|
|
|
|
{% for answer in question.answers.all %}
|
|
|
|
<label class="list-group-item">
|
|
|
|
{{ answer.description }}
|
|
|
|
</label>
|
|
|
|
{% endfor %}
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
2022-01-30 20:04:27 +01:00
|
|
|
{% endfor %}
|
|
|
|
<div class="testContent">
|
2022-01-31 00:09:40 +01:00
|
|
|
<input type="submit" value="Edytuj wybrane pytanie">
|
|
|
|
<button class="defaultButton">
|
|
|
|
<a href="/tests/{{test.id}}/add-question">Dodaj pytanie</a>
|
|
|
|
</button>
|
|
|
|
<button class="defaultButton">
|
|
|
|
<a href="/tests/{{test.id}}/remove-question">Usuwanie pytań</a>
|
|
|
|
</button>
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
2022-01-30 20:04:27 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2022-01-21 18:34:46 +01:00
|
|
|
</div>
|
|
|
|
|
2022-01-30 20:04:27 +01:00
|
|
|
{% endblock %}
|