SOITA/templates/editTest.html

117 lines
4.6 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-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>
</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">
<input type="submit" value="Edytuj wybrane pytanie">
<a href="/tests/{{test.id}}/add-question">Dodaj pytanie</a>
<a href="/tests/{{test.id}}/remove-question">Usun pytanie</a>
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 %}