146 lines
6.4 KiB
HTML
146 lines
6.4 KiB
HTML
{# <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 %}#}
|
|
{##}
|
|
|
|
|
|
{% extends "base.html" %}
|
|
{% load rest_framework %}
|
|
|
|
{% block title %}{{ test.name }}{% endblock %}
|
|
|
|
{% block additional_head %}
|
|
<meta charset="UTF-8">
|
|
<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>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="card" style="border: none;">
|
|
<div class="card-body test_body">
|
|
<div class="editContainerSection">
|
|
<div class="editContainerLine">
|
|
<span><label for="name"><h3>Nazwa:</h3></label></span>
|
|
<span><input id="name" type="text" name="name" value="{{ test.name }}"></span>
|
|
<span><button class="defaultButton">
|
|
<a href='' onclick="this.href='editName?name='+document.getElementById('name').value">Zapisz</a>
|
|
</button></span>
|
|
</div>
|
|
<div class="editContainerLine">
|
|
<!-- <span><label>Aktualna widzialność: {% if test.visible %}Publiczny{% else %}Prywatny{% endif %}</label></span><br>-->
|
|
<span><label for="visible"><h3>Widzialność: </h3></label></span>
|
|
<span><select name="visible" id="visible">
|
|
{% if test.visible %}
|
|
<option selected="selected" value="public" >Publiczny</option>
|
|
<option value="private">Prywatny</option>
|
|
{% endif %}
|
|
{% if not test.visible %}
|
|
<option value="public" >Publiczny</option>
|
|
<option selected="selected" value="private">Prywatny</option>
|
|
{% endif %}
|
|
</select></span>
|
|
<span><button class="defaultButton">
|
|
<a href='' onclick="this.href='editVisible?visible='+document.getElementById('visible').value">Zapisz</a>
|
|
</button></span>
|
|
</div>
|
|
<div class="editContainerLine">
|
|
<span><label for="password"><h3>Hasło:</h3></label></span>
|
|
<span><input id="password" type="text" name="password" value=""></span>
|
|
<span><button class="defaultButton">
|
|
<a href='' onclick="this.href='editPassword?password='+document.getElementById('password').value">Zapisz</a>
|
|
</button></span>
|
|
</div>
|
|
<label><h3>Pytania:</h3></label>
|
|
</div>
|
|
<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 }}>
|
|
</div>
|
|
<div class="list-group">
|
|
{% for answer in question.answers.all %}
|
|
<label class="list-group-item">
|
|
{{ answer.description }}
|
|
</label>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
<div class="testContent">
|
|
<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">Usuń pytania</a>
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|