Feature: Leaderboard difficulty isolation, proposal category select, numeric answer matcher, 25 new questions (65 total)

This commit is contained in:
kobold-ai
2026-09-21 14:23:08 +02:00
parent a938123271
commit b1d88da681
11 changed files with 526 additions and 21 deletions
+1 -1
View File
@@ -309,5 +309,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/admin.js?v=2.2"></script>
<script src="/static/js/admin.js?v=2.3"></script>
{% endblock %}
+1 -1
View File
@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
<title>{% block title %}Magisches Harry-Potter-Escape-Quiz{% endblock %}</title>
<link rel="icon" href="/static/favicon.ico">
<link rel="stylesheet" href="/static/css/style.css?v=2.2">
<link rel="stylesheet" href="/static/css/style.css?v=2.3">
{% block head %}{% endblock %}
</head>
<body>
+4 -2
View File
@@ -96,6 +96,7 @@
const total = {{ total }};
const maxScore = {{ max_score }};
const timeSec = {{ time_seconds }};
const difficulty = "{{ difficulty }}";
let scoreAlreadySubmitted = false;
const WIZARD_NAMES = {
@@ -350,7 +351,7 @@
score: score,
total_questions: total,
time_seconds: timeSec,
difficulty: "all",
difficulty: difficulty,
lang: currentLang
})
});
@@ -386,7 +387,8 @@
async function loadMiniLeaderboard() {
try {
const res = await fetch("/api/leaderboard?limit=5");
const url = "/api/leaderboard?limit=5" + (difficulty && difficulty !== "all" ? `&difficulty=${encodeURIComponent(difficulty)}` : "");
const res = await fetch(url);
const entries = await res.json();
const body = document.getElementById("miniLbBody");
const container = document.getElementById("miniLbContainer");
+1 -1
View File
@@ -113,5 +113,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/quiz.js?v=2.2"></script>
<script src="/static/js/quiz.js?v=2.3"></script>
{% endblock %}
+14 -1
View File
@@ -23,6 +23,19 @@
<textarea id="frage" name="frage" class="textarea" rows="3" placeholder="z. B. Wie heißt der Schulleiter von Hogwarts?" required></textarea>
</div>
<div class="form-group">
<label for="kategorie" id="suggCatLabel">Kategorie / Themenbereich:</label>
<select id="kategorie" name="category" class="input-text">
<option value="hogwarts" id="catHogwarts">🏰 Hogwarts & Schulgelände</option>
<option value="characters" id="catCharacters" selected>🧙 Charaktere & Personen</option>
<option value="spells" id="catSpells">⚡ Zaubersprüche & Magie</option>
<option value="creatures" id="catCreatures">🐉 Magische Tierwesen</option>
<option value="quidditch" id="catQuidditch">🧹 Quidditch & Sport</option>
<option value="lore" id="catLore">🔮 Artefakte & Geschichte</option>
<option value="general" id="catGeneral">📜 Allgemeines Zauberwissen</option>
</select>
</div>
<div class="form-group">
<label for="diff_select" id="suggDiffLabel">Schwierigkeitsgrad:</label>
<select id="diff_select" name="difficulty" class="input-text">
@@ -70,5 +83,5 @@
{% endblock %}
{% block scripts %}
<script src="/static/js/vorschlag.js?v=2.2"></script>
<script src="/static/js/vorschlag.js?v=2.3"></script>
{% endblock %}