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
@@ -525,7 +525,7 @@ function finishGame() {
if (timerInterval) clearInterval(timerInterval);
saveRecentQuestions(sessionQuestionIds);
document.getElementById("progressBar").style.width = "100%";
window.location.href = `/finale?score=${currentScore}&total=${totalQuestions}&time=${elapsedSeconds}&lang=${currentLang}`;
window.location.href = `/finale?score=${currentScore}&total=${totalQuestions}&time=${elapsedSeconds}&lang=${currentLang}&diff=${encodeURIComponent(selectedDifficulty)}`;
}
// Enter key to submit
+37
View File
@@ -5,6 +5,14 @@ const SUGGESTION_TEXT = {
alert: "ℹ️ <strong>Hinweis zur Moderation:</strong> Eingereichte Fragen werden nicht sofort öffentlich sichtbar, sondern erhalten automatisch den Status <em>„Prüfung ausstehend“</em>. Unser Zaubereiministerium prüft und testet die Antwort, bevor die Frage freigeschaltet wird.",
nameLabel: "Dein Name / Zauberer-Alias (optional):",
namePlaceholder: "z. B. Hermine Granger",
catLabel: "Kategorie / Themenbereich:",
catHogwarts: "🏰 Hogwarts & Schulgelände",
catCharacters: "🧙 Charaktere & Personen",
catSpells: "⚡ Zaubersprüche & Magie",
catCreatures: "🐉 Magische Tierwesen",
catQuidditch: "🧹 Quidditch & Sport",
catLore: "🔮 Artefakte & Geschichte",
catGeneral: "📜 Allgemeines Zauberwissen",
frageLabel: "Deine Frage: *",
fragePlaceholder: "z. B. Wie heißt der Schulleiter von Hogwarts?",
diffLabel: "Schwierigkeitsgrad:",
@@ -33,6 +41,14 @@ const SUGGESTION_TEXT = {
alert: "ℹ️ <strong>Moderation Note:</strong> Submitted questions are not immediately public; they automatically receive the status <em>'Pending Review'</em>. The Ministry of Magic tests and verifies the answer before approval.",
nameLabel: "Your Name / Wizard Alias (optional):",
namePlaceholder: "e.g. Hermione Granger",
catLabel: "Category / Topic Area:",
catHogwarts: "🏰 Hogwarts & School Grounds",
catCharacters: "🧙 Characters & People",
catSpells: "⚡ Spells & Magic",
catCreatures: "🐉 Magical Creatures",
catQuidditch: "🧹 Quidditch & Sport",
catLore: "🔮 Artifacts & Lore",
catGeneral: "📜 General Wizarding Lore",
frageLabel: "Your Question: *",
fragePlaceholder: "e.g. Who is the Headmaster of Hogwarts?",
diffLabel: "Difficulty Level:",
@@ -75,11 +91,28 @@ function onLanguageChange(lang) {
const tippInput = document.getElementById("tipp");
const submitBtn = document.getElementById("submitBtn");
const catLabel = document.getElementById("suggCatLabel");
const catHogwarts = document.getElementById("catHogwarts");
const catCharacters = document.getElementById("catCharacters");
const catSpells = document.getElementById("catSpells");
const catCreatures = document.getElementById("catCreatures");
const catQuidditch = document.getElementById("catQuidditch");
const catLore = document.getElementById("catLore");
const catGeneral = document.getElementById("catGeneral");
if (title) title.innerText = t.title;
if (subtitle) subtitle.innerText = t.subtitle;
if (alertBox) alertBox.innerHTML = t.alert;
if (nameLabel) nameLabel.innerText = t.nameLabel;
if (nameInput) nameInput.placeholder = t.namePlaceholder;
if (catLabel) catLabel.innerText = t.catLabel;
if (catHogwarts) catHogwarts.innerText = t.catHogwarts;
if (catCharacters) catCharacters.innerText = t.catCharacters;
if (catSpells) catSpells.innerText = t.catSpells;
if (catCreatures) catCreatures.innerText = t.catCreatures;
if (catQuidditch) catQuidditch.innerText = t.catQuidditch;
if (catLore) catLore.innerText = t.catLore;
if (catGeneral) catGeneral.innerText = t.catGeneral;
if (frageLabel) frageLabel.innerText = t.frageLabel;
if (frageInput) frageInput.placeholder = t.fragePlaceholder;
if (diffLabel) diffLabel.innerText = t.diffLabel;
@@ -151,8 +184,12 @@ async function submitSuggestion(event) {
submitBtn.innerText = t.submitBtnCasting;
try {
const catElem = document.getElementById("kategorie");
const category = catElem ? catElem.value : "general";
const payload = {
name: name || "Gast",
category: category,
frage: frage,
antwort: antwort,
tipp: tipp || null,