Merge branch '139-frage-bei-doppelklick-wird-falschlich-ubersprungen' into 'master'

Resolve "Frage bei Doppelklick wird fälschlich übersprungen!"

Closes #139

See merge request enrichment-2024/qivip!96
This commit is contained in:
ben8
2025-06-14 13:15:18 +00:00
3 changed files with 10 additions and 3 deletions

View File

@@ -1,14 +1,19 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block content %} {% block content %}
{% if request.session.mode == "learn" %}
<div class="container mx-auto px-4"> <div class="container mx-auto px-4">
<div class="flex justify-end mb-4"> <div class="flex justify-end mb-4">
{% if request.session.mode == "learn" %}
<button onclick="leaveGame()" class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded"> <button onclick="leaveGame()" class="bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded">
Spiel verlassen Spiel verlassen
</button> </button>
</div>{% endif %} {% endif %}
<button onclick="this.onclick=null; advanceToScores();" class="mx-2 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded">
weiter
</button>
</div>
<div id="form_host" class="bg-white rounded-lg shadow-md p-4 mb-6"> <div id="form_host" class="bg-white rounded-lg shadow-md p-4 mb-6">
<div class="flex justify-between mb-2"> <div class="flex justify-between mb-2">
<div class="flex gap-1 text-sm"><p class="text-sm">Frage</p> <div class="flex gap-1 text-sm"><p class="text-sm">Frage</p>
@@ -154,6 +159,7 @@
} }
} }
function advanceToScores() { function advanceToScores() {
// Show correct answers and answer counts // Show correct answers and answer counts
var correctOptions = document.querySelectorAll('[data-correct="True"]'); var correctOptions = document.querySelectorAll('[data-correct="True"]');

View File

@@ -89,6 +89,7 @@
data.action === 'show_scores' && data.action === 'show_scores' &&
data.redirect_url) { data.redirect_url) {
window.location.href = data.redirect_url; window.location.href = data.redirect_url;
submitAnswer( -1 );
} }
}; };

View File

@@ -344,7 +344,7 @@ if (antwortRichtig) {
'type': 'next_question', 'type': 'next_question',
'host_id': hostId 'host_id': hostId
})); }));
}); }, { once: true });
} }
{% endif %} {% endif %}
{% endif %} {% endif %}