SOITA/templates/editTest.html

146 lines
6.4 KiB
HTML
Raw Normal View History

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-04-11 12:20:29 +02:00
<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>
2022-01-21 18:34:46 +01:00
</div>
2022-04-11 12:20:29 +02:00
<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>
2022-04-09 13:02:21 +02:00
<option value="private">Prywatny</option>
2022-04-11 12:20:29 +02:00
{% 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>
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">
2022-04-11 12:20:29 +02:00
<a href="/tests/{{test.id}}/remove-question">Usuń pytania</a>
2022-01-31 00:09:40 +01:00
</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 %}