forked from muyrety/Smarter
66 lines
3.4 KiB
Django/Jinja
66 lines
3.4 KiB
Django/Jinja
{% extends "base.j2" %}
|
|
{% block title %} Verify questions {% endblock %}
|
|
|
|
{% block after_bootstrap_js %}
|
|
<script src="{{ url_for('static', filename='js/verify_questions.js') }}"></script>
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="container">
|
|
<div id="confirmDeleteModal" class="modal fade" tabindex="-1">
|
|
<div class="modal-dialog modal-dialog-centered">
|
|
<div class="modal-content bg-info-subtle text-success border-success-subtle">
|
|
<div class="modal-header border-success-subtle">
|
|
<h5 class="modal-title">Confirm deletion</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Do you really want to delete this question? This action is irreversible.</p>
|
|
</div>
|
|
<div class="modal-footer justify-content-evenly border-success-subtle">
|
|
<button type="button" class="btn btn-outline-success" data-bs-dismiss="modal">Cancel</button>
|
|
<form id="confirmDeleteForm" method="post">
|
|
<button type="submit" class="btn btn-outline-danger">Delete</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table class="table table-info border-primary-subtle mt-3">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-primary-emphasis" scope="col">Type</th>
|
|
<th class="text-primary-emphasis" scope="col">Category</th>
|
|
<th class="text-primary-emphasis" scope="col">Difficulty</th>
|
|
<th class="text-primary-emphasis" scope="col">Question</th>
|
|
<th class="text-primary-emphasis" scope="col">Creator username</th>
|
|
<th class="text-primary-emphasis" scope="col">Correct answer</th>
|
|
<th class="text-primary-emphasis" scope="col">Incorrect answers</th>
|
|
<th class="invisible text-primary-emphasis" scope="col">Remove</th>
|
|
<th class="invisible text-primary-emphasis" scope="col">Verify</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for question in questions %}
|
|
<tr>
|
|
<td class="text-primary-emphasis"> {{ question["type"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ question["category"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ question["difficulty"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ question["question"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ question["creator"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ question["correct_answer"] }} </td>
|
|
<td class="text-primary-emphasis"> {{ ", ".join(question["incorrect_answers"]) }} </td>
|
|
<td>
|
|
<button data-bs-toggle="modal" data-bs-target="#confirmDeleteModal" data-bs-question-id="{{ question['id'] }}" class="btn btn-outline-danger">Remove</button>
|
|
</td>
|
|
<td>
|
|
<form method="post" action="{{ url_for('admin.accept_question', id=question["id"]) }}">
|
|
<button type="submit" class="btn btn-outline-primary">Verify</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|