1
0

vault backup: 2025-12-22 12:38:11
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 2m35s

This commit is contained in:
2025-12-22 12:38:11 +01:00
parent 5169a67966
commit 83c795142f
24 changed files with 175 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
{% if show_answer %}
<div class="answer-feedback {{ 'correct' if is_correct else 'incorrect' }}">
<div class="answer-feedback {% if is_correct %}correct{% else %}incorrect{% endif %}">
{% if is_correct %}
✓ Rätt svar!
{% else %}
@@ -59,30 +59,31 @@
let selectedAnswer = null;
function selectOption(letter, questionId, sessionId) {
if ({{ 'true' if show_answer else 'false' }
}) return; // Don't allow changing answer after submission
{% if show_answer %}
return; // Don't allow changing answer after submission
{% endif %}
selectedAnswer = letter;
selectedAnswer = letter;
// Visual feedback
document.querySelectorAll('.option-item').forEach(opt => {
opt.style.borderColor = 'var(--border)';
opt.style.background = 'white';
});
// Visual feedback
document.querySelectorAll('.option-item').forEach(opt => {
opt.style.borderColor = 'var(--border)';
opt.style.background = 'white';
});
const selected = document.getElementById('option-' + letter);
selected.style.borderColor = 'var(--primary)';
selected.style.background = '#f0f4ff';
const selected = document.getElementById('option-' + letter);
selected.style.borderColor = 'var(--primary)';
selected.style.background = '#f0f4ff';
// Submit answer
htmx.ajax('POST', `/submit/${sessionId}/`, {
target: '#quiz-content',
values: {
question_id: questionId,
answer: letter
}
});
}
// Submit answer
htmx.ajax('POST', `/submit/${sessionId}/`, {
target: '#quiz-content',
values: {
question_id: questionId,
answer: letter
}
});
}
function submitDifficulty(difficulty, questionId, sessionId) {
htmx.ajax('POST', `/difficulty/${sessionId}/`, {