60 lines
3.0 KiB
HTML
60 lines
3.0 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block content %}
|
|
<div class="container mx-auto px-4">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h1 class="text-2xl font-bold">{% if question %}Frage bearbeiten{% else %}Neue Wahr/Falsch Frage{% endif %}</h1>
|
|
<a href="{% url 'library:detail_quiz' quiz.id %}"
|
|
class="bg-gray-100 text-gray-700 px-4 py-2 rounded-md hover:bg-gray-200 transition-colors">
|
|
Zurück zum Quiz
|
|
</a>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-lg shadow-md p-6">
|
|
<form method="post" class="space-y-6">
|
|
{% csrf_token %}
|
|
|
|
<!-- Question Text -->
|
|
<div>
|
|
<label for="question" class="block text-sm font-medium text-gray-700">Frage</label>
|
|
<div class="mt-1">
|
|
<textarea name="question" id="question" rows="4"
|
|
class="shadow-sm focus:ring-blue-500 focus:border-blue-500 block w-full sm:text-sm border-gray-300 rounded-md"
|
|
required>{{ question.data.question }}</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- True/False Selection -->
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Richtige Antwort</label>
|
|
<div class="flex space-x-4">
|
|
<label class="inline-flex items-center">
|
|
<input type="radio" name="correct_answer" value="true"
|
|
class="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300"
|
|
{% if question.data.correct_answer %}checked{% endif %}>
|
|
<span class="ml-2 text-sm text-gray-600">Wahr</span>
|
|
</label>
|
|
<label class="inline-flex items-center">
|
|
<input type="radio" name="correct_answer" value="false"
|
|
class="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300"
|
|
{% if not question.data.correct_answer %}checked{% endif %}>
|
|
<span class="ml-2 text-sm text-gray-600">Falsch</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-end space-x-3">
|
|
<a href="{% url 'library:detail_quiz' quiz.id %}"
|
|
class="inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
|
Abbrechen
|
|
</a>
|
|
<button type="submit"
|
|
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
|
|
{% if question %}Speichern{% else %}Erstellen{% endif %}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|