fix-Multiple-choice (verursacht bei Änderung - darkMode)

This commit is contained in:
ben8
2025-07-13 13:31:25 +02:00
parent 4ac5dd794b
commit f80e35a0d0

View File

@@ -50,7 +50,7 @@
<input type="checkbox" name="correct_{{ forloop.counter }}" value="1" <input type="checkbox" name="correct_{{ forloop.counter }}" value="1"
class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded" class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"
{% if option.is_correct %}checked{% endif %}> {% if option.is_correct %}checked{% endif %}>
<span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white dark:text-white">Richtig</span>
</label> </label>
<button type="button" onclick="removeOption(this)" <button type="button" onclick="removeOption(this)"
class="text-red-600 hover:text-red-800 transition-colors"> class="text-red-600 hover:text-red-800 transition-colors">
@@ -63,12 +63,12 @@
{% else %} {% else %}
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<textarea name="option_1" rows="2" <textarea name="option_1" rows="2"
class="shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md" class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md"
required></textarea> required></textarea>
<label class="inline-flex items-center"> <label class="inline-flex items-center">
<input type="checkbox" name="correct_1" value="1" <input type="checkbox" name="correct_1" value="1"
class="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"> class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-600">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span>
</label> </label>
<button type="button" onclick="removeOption(this)" <button type="button" onclick="removeOption(this)"
class="text-red-600 hover:text-red-800 transition-colors"> class="text-red-600 hover:text-red-800 transition-colors">
@@ -79,12 +79,12 @@
</div> </div>
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<textarea name="option_2" rows="2" <textarea name="option_2" rows="2"
class="shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md" class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md"
required></textarea> required></textarea>
<label class="inline-flex items-center"> <label class="inline-flex items-center">
<input type="checkbox" name="correct_2" value="1" <input type="checkbox" name="correct_2" value="1"
class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"> class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-600">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span>
</label> </label>
<button type="button" onclick="removeOption(this)" <button type="button" onclick="removeOption(this)"
class="text-red-600 hover:text-red-800 transition-colors"> class="text-red-600 hover:text-red-800 transition-colors">
@@ -95,12 +95,12 @@
</div> </div>
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<textarea name="option_3" rows="2" <textarea name="option_3" rows="2"
class="shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md" class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md"
required></textarea> required></textarea>
<label class="inline-flex items-center"> <label class="inline-flex items-center">
<input type="checkbox" name="correct_3" value="1" <input type="checkbox" name="correct_3" value="1"
class="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"> class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-600">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span>
</label> </label>
<button type="button" onclick="removeOption(this)" <button type="button" onclick="removeOption(this)"
class="text-red-600 hover:text-red-800 transition-colors"> class="text-red-600 hover:text-red-800 transition-colors">
@@ -111,12 +111,12 @@
</div> </div>
<div class="flex items-center space-x-3"> <div class="flex items-center space-x-3">
<textarea name="option_4" rows="2" <textarea name="option_4" rows="2"
class="shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md" class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md"
required></textarea> required></textarea>
<label class="inline-flex items-center"> <label class="inline-flex items-center">
<input type="checkbox" name="correct_4" value="1" <input type="checkbox" name="correct_4" value="1"
class="focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"> class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded">
<span class="ml-2 text-sm text-gray-600">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span>
</label> </label>
<button type="button" onclick="removeOption(this)" <button type="button" onclick="removeOption(this)"
class="text-red-600 hover:text-red-800 transition-colors"> class="text-red-600 hover:text-red-800 transition-colors">
@@ -182,11 +182,11 @@ function addOption() {
const div = document.createElement('div'); const div = document.createElement('div');
div.className = 'flex items-center space-x-3'; div.className = 'flex items-center space-x-3';
div.innerHTML = ` div.innerHTML = `
<textarea name="option_{{ forloop.counter }}" rows="2" <textarea name="option_${optionCount}" rows="2"
class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md" class="dark:bg-[#2a2f3a] shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 flex-grow sm:text-sm border-gray-300 rounded-md"
required>{{ option.value }}</textarea> required>{{ option.value }}</textarea>
<label class="inline-flex items-center"> <label class="inline-flex items-center">
<input type="checkbox" name="correct_{{ forloop.counter }}" value="1" <input type="checkbox" name="correct_${optionCount}" value="1"
class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded" class=" focus:outline-none focus:ring-2 focus:ring-blue-500 h-4 w-4 text-blue-600 border-gray-300 rounded"
{% if option.is_correct %}checked{% endif %}> {% if option.is_correct %}checked{% endif %}>
<span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span> <span class="ml-2 text-sm text-gray-600 dark:text-white">Richtig</span>