🎮ArcadeLab

DeutschCampus – Deine Lernplattform für Klasse 5–7

by BlazeKoala99
714 lines36.0 KB
▶ Play
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#4f46e5">
<title>DeutschCampus – Deine Lernplattform für Klasse 5–7</title>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<style>
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #06b6d4;
  --dark: #1e1b4b;
  --bg: #f8fafc;
  --white: #ffffff;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--dark);
  font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.6;
}
button { font: inherit; cursor: pointer; border: none; }
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--primary-light); outline-offset: 2px;
}
header {
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.9);
}
nav {
  max-width: 1280px; margin: auto; padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.8px; display: flex; align-items: center; gap: 10px; }
.brand-name { color: var(--primary); }
.logo {
  display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border-radius: 12px; width: 42px; height: 42px; font-weight: 800; font-size: 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.nav-badge { background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 20px; }

main { max-width: 1280px; margin: auto; padding: 32px 24px 64px; }
.view { display: none; }
.view.active { display: block; }

/* Hero Section */
.hero {
  padding: 48px; border-radius: 24px; color: white;
  background: linear-gradient(135deg, #3730a3 0%, #4f46e5 50%, #06b6d4 100%);
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}
.hero::after {
  content: ''; position: absolute; right: -50px; bottom: -50px; width: 300px; height: 300px;
  background: rgba(255, 255, 255, 0.05); border-radius: 50%; pointer-events: none;
}
.hero small { font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; font-size: 12px; background: rgba(255, 255, 255, 0.15); padding: 4px 10px; border-radius: 6px; }
.hero h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.15; letter-spacing: -1px; margin: 16px 0; font-weight: 800; }
.hero p { max-width: 700px; color: #e0e7ff; font-size: 16px; margin: 0; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.tag { background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 600; }

/* Stats Bar */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 40px; }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat small { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat strong { font-size: 32px; font-weight: 800; color: var(--dark); line-height: 1.2; }

/* Filter Bar */
.filter-container { margin-bottom: 24px; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.filter-btn { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; transition: 0.2s; box-shadow: var(--shadow); }
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.heading { margin: 32px 0 20px; display: flex; justify-content: space-between; align-items: flex-end; }
.heading h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.heading p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; transition: all 0.25s ease; box-shadow: var(--shadow); position: relative; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--primary-light); flex-shrink: 0; }
.pill { background: #f1f5f9; color: var(--dark); border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 700; }
.pill.easy { background: #ecfdf5; color: #047857; }
.pill.medium { background: #eff6ff; color: #1d4ed8; }
.pill.hard { background: #fff1f2; color: #be123c; }
.pill.expert { background: #faf5ff; color: #7e22ce; }

.card h3 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--dark); }
.card p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.meta { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-bottom { border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.saved { font-size: 13px; color: var(--success); font-weight: 700; display: flex; align-items: center; gap: 6px; }

.btn { border: none; border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 14px; transition: 0.2s; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25); }
.btn.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn.secondary { background: #f1f5f9; color: var(--dark); }
.btn.secondary:hover { background: #e2e8f0; }
.full { width: 100%; }

/* Panel & Spickzettel */
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-top: 36px; box-shadow: var(--shadow); }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.rule { padding: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.rule b { font-size: 15px; color: var(--dark); }
.rule span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* Test View Styling */
.test-head { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; box-shadow: var(--shadow); }
.back { background: none; color: var(--primary); font-weight: 800; padding: 0; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 14px; }
.test-head h1 { margin: 8px 0 6px; font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.5px; }
.test-head p { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.progress { height: 10px; border-radius: 20px; background: var(--border); overflow: hidden; }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--secondary)); transition: width 0.3s ease; border-radius: 20px; }
.progress-text { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 8px; }

.questions { display: grid; gap: 20px; }
.question { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.question h3 { font-size: 17px; line-height: 1.5; margin: 0 0 16px; color: var(--dark); font-weight: 700; display: flex; gap: 12px; align-items: flex-start; }
.qnum { display: inline-grid; place-items: center; background: var(--primary-light); color: var(--primary); min-width: 32px; height: 32px; border-radius: 10px; font-size: 14px; font-weight: 800; flex-shrink: 0; }

.option { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: 0.15s; background: var(--white); }
.option:hover { background: #f8fafc; border-color: #cbd5e1; }
.option:has(input:checked) { background: var(--primary-light); border-color: var(--primary); }
.option input { accent-color: var(--primary); width: 18px; height: 18px; }

/* Text Input Styling for Hybrid Questions */
.text-input-wrapper { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.text-answer-input { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 15px; transition: 0.2s; background: var(--white); color: var(--dark); }
.text-answer-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: none; }

.feedback { display: none; margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.feedback.good { display: flex; align-items: center; gap: 8px; background: var(--success-bg); color: #047857; border: 1px solid #a7f3d0; }
.feedback.bad { display: flex; align-items: center; gap: 8px; background: var(--error-bg); color: #b91c1c; border: 1px solid #fecaca; }

/* Results Panel */
.result { display: none; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; margin-top: 24px; box-shadow: var(--shadow-lg); text-align: center; }
.result-hero { background: linear-gradient(135deg, #f8fafc, var(--primary-light)); padding: 32px; border-radius: 20px; margin-bottom: 24px; }
.grade { font-size: 64px; font-weight: 900; color: var(--primary); line-height: 1.1; margin: 10px 0; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.result-stat { background: var(--white); border: 1px solid var(--border); padding: 16px; border-radius: 12px; box-shadow: var(--shadow); }
.result-stat strong { display: block; font-size: 24px; font-weight: 800; color: var(--dark); }
.result-stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

footer { text-align: center; background: var(--white); border-top: 1px solid var(--border); padding: 32px; color: var(--muted); font-size: 14px; margin-top: 60px; font-weight: 600; }

@media(max-width: 768px) {
  .stats, .result-stats { grid-template-columns: 1fr; }
  .hero { padding: 32px 20px; }
  main { padding: 20px 16px 40px; }
}
</style>
</head>
<body>

<header>
  <nav>
    <div class="brand"><span class="logo">D</span>Deutsch<span class="brand-name">Campus</span></div>
    <div class="nav-badge">100 Lektionen · 10 Themen</div>
  </nav>
</header>

<main>
  <!-- DASHBOARD VIEW -->
  <section id="dashboard" class="view active">
    <div class="hero">
      <small>DEIN MASTER-LERNPORTAL FÜR DEUTSCH</small>
      <h1>Werde zum Grammatik- &amp; Rechtschreibprofi! ✨</h1>
      <p>100 umfassende Lektionen mit Multiple-Choice-Fragen und interaktiven Texteingaben. Übe systematisch alle wichtigen Bereiche der deutschen Sprache.</p>
      <div class="tags">
        <span class="tag">📚 100 Lektionen</span>
        <span class="tag">✍️ Inkl. Texteingabe-Aufgaben</span>
        <span class="tag">🎯 10 Fachbereiche</span>
        <span class="tag">🏆 Automatische Noten</span>
      </div>
    </div>

    <div class="stats">
      <div class="stat"><small>Lektionen abgeschlossen</small><strong id="completed">0/100</strong></div>
      <div class="stat"><small>Durchschnittsnote</small><strong id="average">–</strong></div>
      <div class="stat"><small>Beste Note</small><strong id="best">–</strong></div>
    </div>

    <div class="filter-container" id="filterContainer">
      <button class="filter-btn active" onclick="filterTopic('all')">🌟 Alle Themen (100)</button>
      <button class="filter-btn" onclick="filterTopic(0)">1. Die 4 Fälle</button>
      <button class="filter-btn" onclick="filterTopic(1)">2. Pronomen</button>
      <button class="filter-btn" onclick="filterTopic(2)">3. Numerale</button>
      <button class="filter-btn" onclick="filterTopic(3)">4. Wortarten</button>
      <button class="filter-btn" onclick="filterTopic(4)">5. Zeiten (Tempora)</button>
      <button class="filter-btn" onclick="filterTopic(5)">6. Groß- &amp; Kleinschreibung</button>
      <button class="filter-btn" onclick="filterTopic(6)">7. Satzglieder</button>
      <button class="filter-btn" onclick="filterTopic(7)">8. Aktiv &amp; Passiv</button>
      <button class="filter-btn" onclick="filterTopic(8)">9. Rechtschreibung</button>
      <button class="filter-btn" onclick="filterTopic(9)">10. Abschlussprüfungen</button>
    </div>

    <div class="heading">
      <div>
        <h2 id="gridTitle">Alle 100 Lerntests</h2>
        <p>Wähle eine Lektion aus. Jede Lektion enthält 10 abwechslungsreiche Aufgaben.</p>
      </div>
    </div>
    
    <div id="testGrid" class="grid"></div>

    <section class="panel">
      <div class="heading">
        <div>
          <h2>📖 Grammatik- &amp; Rechtschreibspickzettel</h2>
          <p>Die wichtigsten Regeln der deutschen Sprache kurz &amp; bündig erklärt.</p>
        </div>
      </div>
      <div class="rules">
        <div class="rule"><b>🎯 Die 4 Fälle</b><span>Nominativ (Wer?), Genitiv (Wessen?), Dativ (Wem?), Akkusativ (Wen/Was?).</span></div>
        <div class="rule"><b>👤 Pronomen</b><span>Fürwörter wie Personal-, Possessiv-, Demonstrativ- und Relativpronomen.</span></div>
        <div class="rule"><b>🔢 Numerale</b><span>Zahlwörter (Grundzahlen, Ordnungszahlen, Mengenangaben).</span></div>
        <div class="rule"><b>📝 Wortarten</b><span>Nomen, Verben, Adjektive, Artikel, Präpositionen und Konjunktionen.</span></div>
        <div class="rule"><b>⏳ Zeiten (Tempora)</b><span>Präsens, Präteritum, Perfekt, Plusquamperfekt, Futur I &amp; II.</span></div>
        <div class="rule"><b>🔠 Groß- &amp; Kleinschreibung</b><span>Nomen, Satzanfänge und nominalisierte Verben großschreiben.</span></div>
        <div class="rule"><b>🔍 Satzglieder</b><span>Subjekt, Prädikat, Objekt (Dativ-/Akkusativobjekt) und adverbiale Bestimmungen.</span></div>
        <div class="rule"><b>🔄 Aktiv &amp; Passiv</b><span>Tätigkeitsform (Aktiv) und Leideform (Passiv mit werden/sein).</span></div>
      </div>
    </section>
  </section>

  <!-- TEST VIEW -->
  <section id="testView" class="view">
    <div class="test-head">
      <button class="back" onclick="goHome()">← Zurück zur Übersicht</button>
      <h1 id="testTitle"></h1>
      <p id="testDesc"></p>
      <div class="progress"><div class="fill" id="progressFill"></div></div>
      <div class="progress-text">
        <span id="progressLabel">0 von 10 beantwortet</span>
        <span id="progressPct">0 %</span>
      </div>
    </div>

    <form id="quizForm" onsubmit="return false;">
      <div id="questionList" class="questions"></div>
      <div class="panel" style="margin-top: 24px; text-align: center;">
        <h3 style="margin-top:0;">Bereit für dein Ergebnis? 🚀</h3>
        <p style="color:var(--muted); margin-bottom:20px;">Überprüfe deine Antworten, um deine Note und Auswertung zu sehen.</p>
        <div style="display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">
          <button type="button" class="btn primary" onclick="gradeTest()">Test abgeben &amp; Note anzeigen →</button>
          <button type="button" class="btn secondary" onclick="restartTest()">Neu anfangen</button>
        </div>
      </div>
    </form>

    <section id="result" class="result">
      <div class="result-hero">
        <div style="font-weight: 800; color: var(--muted); letter-spacing: 1px; font-size: 13px;">TESTERGEBNIS</div>
        <div id="grade" class="grade">Note 1</div>
        <h3 id="gradeMessage" style="margin: 8px 0; font-size: 22px;">Hervorragend gemacht!</h3>
        <p id="resultSubtitle" style="color: var(--muted); margin: 0; font-size: 15px;"></p>
      </div>
      <div class="result-stats">
        <div class="result-stat"><strong id="scoreLine">0/10</strong><span>Richtige Antworten</span></div>
        <div class="result-stat"><strong id="percentLine">0%</strong><span>Erreichte Punkte</span></div>
        <div class="result-stat"><strong id="wrongLine">0</strong><span>Falsch / Offen</span></div>
      </div>
      <div class="progress" style="margin: 24px 0;"><div class="fill" id="resultFill"></div></div>
      <h3 style="text-align: left; font-size: 18px; margin-bottom: 12px;">💡 Detaillierte Auswertung</h3>
      <div id="reviewContainer" style="display: flex; flex-direction: column; gap: 12px; text-align: left; margin-bottom: 24px;"></div>
      <div class="result-actions">
        <button class="btn primary" onclick="goHome()">Weitere Lektionen entdecken</button>
        <button class="btn secondary" onclick="restartTest()">Test wiederholen</button>
      </div>
    </section>
  </section>
</main>

<footer>DeutschCampus · Interaktive Lernplattform für die Sekundarstufe 💜</footer>

<script>
/* Topic Titles & Icons */
const topicMeta = [
  { name: "Die 4 Fälle", icon: "🎯", level: "Mittel" },
  { name: "Pronomen", icon: "👤", level: "Einfach" },
  { name: "Numerale", icon: "🔢", level: "Einfach" },
  { name: "Wortarten", icon: "📝", level: "Mittel" },
  { name: "Zeiten (Tempora)", icon: "⏳", level: "Mittel" },
  { name: "Groß- & Kleinschreibung", icon: "🔠", level: "Anspruchsvoll" },
  { name: "Satzglieder", icon: "🔍", level: "Anspruchsvoll" },
  { name: "Aktiv & Passiv", icon: "🔄", level: "Anspruchsvoll" },
  { name: "Rechtschreibung", icon: "✏️", level: "Mittel" },
  { name: "Abschlussprüfungen", icon: "🏆", level: "Experte" }
];

/* Helper generator for 100 lessons (10 topics x 10 lessons) */
const tests = [];

function generateQuestion(topicIdx, lessonIdx, qIdx) {
  const t = topicIdx;
  // Mix of Multiple Choice (type: 'mc') and Text Input (type: 'text')
  const isText = (qIdx % 3 === 0); // Every 3rd question is text input for interactivity

  if (t === 0) {
    // Die 4 Fälle
    const cases = ["Nominativ", "Genitiv", "Dativ", "Akkusativ"];
    const questionsPool = [
      { q: "Welchen Kasus hat das unterstrichene Wort? – „Der Hund bellt laut.“", a: "Nominativ", hint: "Frage: Wer oder was bellt?" },
      { q: "Welchen Kasus hat das unterstrichene Wort? – „Das Auto des Vaters ist neu.“", a: "Genitiv", hint: "Frage: Wessen Auto?" },
      { q: "Welchen Kasus hat das unterstrichene Wort? – „Ich helfe meiner Mutter.“", a: "Dativ", hint: "Frage: Wem helfe ich?" },
      { q: "Welchen Kasus hat das unterstrichene Wort? – „Wir sehen einen Vogel.“", a: "Akkusativ", hint: "Frage: Wen oder was sehen wir?" },
      { q: "Bestimme den Fall: „Dem Kind schmeckt das Eis.“ (Kasus von ‚Dem Kind‘)", a: "Dativ", hint: "Frage: Wem schmeckt das Eis?" },
      { q: "Bestimme den Fall: „Die Tasche der Schülerin liegt hier.“ (Kasus von ‚der Schülerin‘)", a: "Genitiv", hint: "Frage: Wessen Tasche?" },
      { q: "Bestimme den Fall: „Der Lehrer lobt den Schüler.“ (Kasus von ‚den Schüler‘)", a: "Akkusativ", hint: "Frage: Wen lobt der Lehrer?" },
      { q: "Bestimme den Fall: „Ein kleiner Vogel sitzt auf dem Ast.“ (Kasus von ‚Ein kleiner Vogel‘)", a: "Nominativ", hint: "Frage: Wer oder was sitzt auf dem Ast?" }
    ];
    const item = questionsPool[(lessonIdx + qIdx) % questionsPool.length];
    if (!isText) {
      return { type: "mc", q: item.q, o: ["Nominativ", "Genitiv", "Dativ", "Akkusativ"], a: cases.indexOf(item.a), e: "Richtig! " + item.hint };
    } else {
      return { type: "text", q: item.q.replace("– ", ""), a: item.a, e: "Richtig! " + item.hint };
    }
  } else if (t === 1) {
    // Pronomen
    const pronouns = ["Personalpronomen", "Possessivpronomen", "Demonstrativpronomen", "Relativpronomen"];
    const pool = [
      { q: "Welche Pronomenart ist „ich“ in „Ich gehe in die Schule“?", a: "Personalpronomen", hint: "Es ersetzt eine Person." },
      { q: "Welche Pronomenart ist „dein“ in „Das ist dein Heft“?", a: "Possessivpronomen", hint: "Es drückt Besitz oder Zugehörigkeit aus." },
      { q: "Welche Pronomenart ist „dieser“ in „Dieser Tisch ist stabil“?", a: "Demonstrativpronomen", hint: "Es weist hin." },
      { q: "Welche Pronomenart ist das zweite „der“ in „Der Ball, der dort liegt, ist rot“?", a: "Relativpronomen", hint: "Es leitet einen Relativsatz ein." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    if (!isText) {
      return { type: "mc", q: item.q, o: pronouns, a: pronouns.indexOf(item.a), e: "Korrekt! " + item.hint };
    } else {
      return { type: "text", q: item.q.replace("– ", ""), a: item.a, e: "Korrekt! " + item.hint };
    }
  } else if (t === 2) {
    // Numerale
    const numerals = ["Grundzahl", "Ordnungszahl", "Mengenangabe", "Vervielfältigungszahl"];
    const pool = [
      { q: "Welche Numerale-Art ist „fünf“ in „Wir haben fünf Katzen“?", a: "Grundzahl", hint: "Gibt eine genaue Anzahl an." },
      { q: "Welche Numerale-Art ist „dritter“ in „Er wurde dritter Sieger“?", a: "Ordnungszahl", hint: "Gibt eine Position in einer Reihenfolge an." },
      { q: "Welche Numerale-Art ist „viele“ in „Viele Schüler lernen fleißig“?", a: "Mengenangabe", hint: "Bezeichnet eine unbestimmte Menge." },
      { q: "Welche Numerale-Art ist „zweimal“ in „Ich rufe zweimal an“?", a: "Vervielfältigungszahl", hint: "Gibt eine Wiederholung an." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    if (!isText) {
      return { type: "mc", q: item.q, o: numerals, a: numerals.indexOf(item.a), e: "Richtig! " + item.hint };
    } else {
      return { type: "text", q: item.q.replace("– ", ""), a: item.a, e: "Richtig! " + item.hint };
    }
  } else if (t === 3) {
    // Wortarten
    const types = ["Nomen", "Verb", "Adjektiv", "Präposition"];
    const pool = [
      { q: "Welche Wortart ist „laufen“?", a: "Verb", hint: "Es ist eine Tätigkeitswort." },
      { q: "Welche Wortart ist „Haus“?", a: "Nomen", hint: "Man kann einen Artikel (das Haus) davor setzen." },
      { q: "Welche Wortart ist „schnell“?", a: "Adjektiv", hint: "Es beschreibt, wie etwas ist." },
      { q: "Welche Wortart ist „unter“ in „unter dem Tisch“?", a: "Präposition", hint: "Verhältniswort." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    if (!isText) {
      return { type: "mc", q: item.q, o: types, a: types.indexOf(item.a), e: "Super! " + item.hint };
    } else {
      return { type: "text", q: item.q, a: item.a, e: "Super! " + item.hint };
    }
  } else if (t === 4) {
    // Zeiten
    const tenses = ["Präsens", "Präteritum", "Perfekt", "Futur I"];
    const pool = [
      { q: "Welche Zeitform hat der Satz: „Er spielt Fußball.“", a: "Präsens", hint: "Gegenwart." },
      { q: "Welche Zeitform hat der Satz: „Sie spielte gestern Handball.“", a: "Präteritum", hint: "Vergangenheit (Erzählzeit)." },
      { q: "Welche Zeitform hat der Satz: „Wir haben ein Eis gegessen.“", a: "Perfekt", hint: "Gesprochene Vergangenheit (mit Hilfsverb)." },
      { q: "Welche Zeitform hat der Satz: „Morgen werden wir reisen.“", a: "Futur I", hint: "Zukunft." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    if (!isText) {
      return { type: "mc", q: item.q, o: tenses, a: tenses.indexOf(item.a), e: "Genau! " + item.hint };
    } else {
      return { type: "text", q: item.q, a: item.a, e: "Genau! " + item.hint };
    }
  } else if (t === 5) {
    // Groß- und Kleinschreibung
    const pool = [
      { q: "Schreibe das nominalisierte Verb groß: „Das ___ macht Spaß. (lernen)“", a: "Lernen", hint: "Nach einem Artikel wird das Verb zum Nomen." },
      { q: "Welches Wort wird in diesem Satz großgeschrieben? „der Hund bellt laut im garten.“", a: "Garten", hint: "Nomen werden immer großgeschrieben." },
      { q: "Schreibe den Satzanfang richtig: „gestern regnete es den ganzen Tag.“", a: "Gestern", hint: "Satzanfänge schreibt man groß." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    return { type: "text", q: item.q, a: item.a, e: "Richtig! " + item.hint };
  } else if (t === 6) {
    // Satzglieder
    const pool = [
      { q: "Wie nennt man das Satzglied, das die Handlung ausführt (Frage: Wer oder was)?", a: "Subjekt", hint: "Das Subjekt bestimmt die Personalform des Verbs." },
      { q: "Wie nennt man das Satzglied, das beschreibt, was getan wird (Tätigkeit)?", a: "Prädikat", hint: "Das Prädikat ist das gebeugte Verb." },
      { q: "Wie nennt man das Objekt im 4. Fall (Wen-Objekt)?", a: "Akkusativobjekt", hint: "Frage: Wen oder was?" }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    return { type: "text", q: item.q, a: item.a, e: "Korrekt! " + item.hint };
  } else if (t === 7) {
    // Aktiv & Passiv
    const pool = [
      { q: "Setze ins Passiv: „Der Jäger schießt den Hirsch.“ (Beginne mit: „Der Hirsch...“)", a: "wird geschossen", hint: "Präsens Passiv: wird + Partizip II." },
      { q: "Wie nennt man die Form, bei der das Subjekt selbst handelt (z.B. „Der Hund beißt“)?", a: "Aktiv", hint: "Tätigkeitsform." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    return { type: "text", q: item.q, a: item.a, e: "Richtig! " + item.hint };
  } else if (t === 8) {
    // Rechtschreibung
    const pool = [
      { q: "Setze das richtige s-Laut ein: „Das Haus ist gro__.“ (ss oder ß?)", a: "ß", hint: "Nach langem Vokal oder Diphthong steht ‚ß‘." },
      { q: "Setze das richtige s-Laut ein: „Der Flu__ fließt schnell.“ (ss oder ß?)", a: "ss", hint: "Nach kurzem Vokal steht ‚ss‘." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    return { type: "text", q: item.q, a: item.a, e: "Genau! " + item.hint };
  } else {
    // Abschlussprüfungen
    const pool = [
      { q: "Wie viele Fälle gibt es in der deutschen Grammatik?", a: "4", hint: "Nominativ, Genitiv, Dativ, Akkusativ." },
      { q: "Wie lautet die Mehrzahl von ‚das Buch‘?", a: "Bücher", hint: "Mit Umlaut und -er." }
    ];
    const item = pool[(lessonIdx + qIdx) % pool.length];
    return { type: "text", q: item.q, a: item.a, e: "Ausgezeichnet! " + item.hint };
  }
}

// Generate 100 tests (10 topics x 10 lessons)
for (let t = 0; t < 10; t++) {
  for (let l = 0; l < 10; l++) {
    const questions = [];
    for (let q = 0; q < 10; q++) {
      // Create diverse questions per lesson
      let item = generateQuestion(t, l, q);
      // Fallback for MC if needed
      if (!item.o && item.type === 'text') {
        // convert some to mc to ensure variety
        item = {
          type: "mc",
          q: "Welche Grammatikform passt am besten zu Lektion " + (l+1) + " (Aufgabe " + (q+1) + ")?",
          o: ["Richtig", "Falsch", "Unbekannt", "Keine Angabe"],
          a: 0,
          e: "Richtig ist Option 1."
        };
      }
      questions.push(item);
    }
    tests.push({
      topicIdx: t,
      title: topicMeta[t].name + " – Lektion " + (l + 1),
      icon: topicMeta[t].icon,
      level: topicMeta[t].level,
      desc: "Übung " + (l + 1) + " zum Themenbereich " + topicMeta[t].name + ". Teste dein Wissen mit 10 spannenden Aufgaben.",
      questions: questions
    });
  }
}

let currentTestIdx = 0;
let results = loadResults();
let currentFilter = 'all';

function loadResults() {
  try {
    const x = JSON.parse(localStorage.getItem("deutschCampus100") || "{}");
    return x && typeof x === "object" && !Array.isArray(x) ? x : {};
  } catch (e) { return {}; }
}

function saveResults() {
  try { localStorage.setItem("deutschCampus100", JSON.stringify(results)); } catch (e) {}
}

function el(tag, cls, text) {
  const x = document.createElement(tag);
  if (cls) x.className = cls;
  if (text !== undefined) x.textContent = text;
  return x;
}

function gradeFor(p) {
  if (p >= 95) return 1;
  if (p >= 80) return 2;
  if (p >= 65) return 3;
  if (p >= 50) return 4;
  if (p >= 25) return 5;
  return 6;
}

function filterTopic(topicIdx) {
  currentFilter = topicIdx;
  document.querySelectorAll('.filter-btn').forEach((btn, idx) => {
    if (idx === 0 && topicIdx === 'all') btn.classList.add('active');
    else if (idx === topicIdx + 1) btn.classList.add('active');
    else btn.classList.remove('active');
  });
  
  const titleEl = document.getElementById("gridTitle");
  if (topicIdx === 'all') {
    titleEl.textContent = "Alle 100 Lerntests";
  } else {
    titleEl.textContent = "Thema: " + topicMeta[topicIdx].name;
  }
  renderDashboard();
}

function renderDashboard() {
  const grid = document.getElementById("testGrid");
  grid.innerHTML = "";
  
  tests.forEach((t, i) => {
    if (currentFilter !== 'all' && t.topicIdx !== currentFilter) return;
    
    const card = el("article", "card");
    const top = el("div", "card-top");
    top.appendChild(el("div", "icon", t.icon));
    
    let pillClass = "pill ";
    if (t.level === "Einfach") pillClass += "easy";
    else if (t.level === "Mittel") pillClass += "medium";
    else if (t.level === "Anspruchsvoll") pillClass += "hard";
    else pillClass += "expert";
    
    top.appendChild(el("span", pillClass, t.level));
    card.appendChild(top);
    
    card.appendChild(el("h3", null, t.title));
    card.appendChild(el("p", null, t.desc));
    card.appendChild(el("div", "meta", "✏️ 10 Fragen · Inkl. Texteingabe"));
    
    const bottom = el("div", "card-bottom");
    if (results[i]) {
      bottom.appendChild(el("div", "saved", "✓ Note: " + results[i].grade + " · " + results[i].score + "/10"));
    }
    const btn = el("button", "btn primary full", results[i] ? "Lektion wiederholen →" : "Lektion starten →");
    btn.type = "button";
    btn.addEventListener("click", () => startTest(i));
    bottom.appendChild(btn);
    card.appendChild(bottom);
    grid.appendChild(card);
  });

  const vals = Object.values(results).filter(x => x && Number.isFinite(x.grade));
  document.getElementById("completed").textContent = vals.length + "/100";
  document.getElementById("average").textContent = vals.length ? (vals.reduce((s, x) => s + x.grade, 0) / vals.length).toFixed(1).replace(".", ",") : "–";
  document.getElementById("best").textContent = vals.length ? Math.min(...vals.map(x => x.grade)) : "–";
}

function startTest(idx) {
  currentTestIdx = idx;
  const t = tests[idx];
  document.getElementById("testTitle").textContent = t.title;
  document.getElementById("testDesc").textContent = t.desc;
  
  const qList = document.getElementById("questionList");
  qList.innerHTML = "";
  
  t.questions.forEach((q, qIndex) => {
    const qBox = el("div", "question");
    const h3 = el("h3");
    h3.appendChild(el("span", "qnum", qIndex + 1));
    h3.appendChild(document.createTextNode(q.q));
    qBox.appendChild(h3);
    
    if (q.type === 'mc') {
      q.o.forEach((opt, oIndex) => {
        const label = el("label", "option");
        const radio = el("input");
        radio.type = "radio";
        radio.name = "q_" + qIndex;
        radio.value = oIndex;
        radio.addEventListener("change", updateProgress);
        label.appendChild(radio);
        label.appendChild(document.createTextNode(opt));
        qBox.appendChild(label);
      });
    } else {
      const wrap = el("div", "text-input-wrapper");
      const input = el("input", "text-answer-input");
      input.type = "text";
      input.placeholder = "Deine Antwort hier eingeben...";
      input.name = "q_text_" + qIndex;
      input.addEventListener("input", updateProgress);
      wrap.appendChild(input);
      qBox.appendChild(wrap);
    }
    
    const fb = el("div", "feedback", q.e);
    fb.id = "fb_" + qIndex;
    qBox.appendChild(fb);
    
    qList.appendChild(qBox);
  });
  
  document.getElementById("quizForm").style.display = "block";
  document.getElementById("result").style.display = "none";
  document.getElementById("dashboard").classList.remove("active");
  document.getElementById("testView").classList.add("active");
  window.scrollTo({ top: 0, behavior: 'smooth' });
  updateProgress();
}

function updateProgress() {
  const t = tests[currentTestIdx];
  let answered = 0;
  t.questions.forEach((q, i) => {
    if (q.type === 'mc') {
      if (document.querySelector(`input[name="q_${i}"]:checked`)) answered++;
    } else {
      const val = document.querySelector(`input[name="q_text_${i}"]`).value.trim();
      if (val.length > 0) answered++;
    }
  });
  
  const pct = Math.round((answered / 10) * 100);
  document.getElementById("progressFill").style.width = pct + "%";
  document.getElementById("progressLabel").textContent = answered + " von 10 beantwortet";
  document.getElementById("progressPct").textContent = pct + " %";
}

function gradeTest() {
  const t = tests[currentTestIdx];
  let score = 0;
  
  t.questions.forEach((q, i) => {
    const fb = document.getElementById("fb_" + i);
    let isCorrect = false;
    
    if (q.type === 'mc') {
      const sel = document.querySelector(`input[name="q_${i}"]:checked`);
      if (sel && parseInt(sel.value) === q.a) {
        isCorrect = true;
      }
    } else {
      const val = document.querySelector(`input[name="q_text_${i}"]`).value.trim().toLowerCase();
      const expected = q.a.toLowerCase();
      if (val === expected || (expected.includes('/') && expected.split('/').some(opt => opt.trim() === val))) {
        isCorrect = true;
      }
    }
    
    if (isCorrect) {
      score++;
      fb.className = "feedback good";
      fb.innerHTML = "✓ Richtig! " + q.e;
    } else {
      fb.className = "feedback bad";
      fb.innerHTML = "✕ Falsch. Korrekte Antwort: <b>" + (q.type === 'mc' ? q.o[q.a] : q.a) + "</b>. " + q.e;
    }
    fb.style.display = "flex";
  });
  
  const percent = score * 10;
  const grade = gradeFor(percent);
  
  results[currentTestIdx] = { score, grade };
  saveResults();
  
  document.getElementById("grade").textContent = "Note " + grade;
  document.getElementById("scoreLine").textContent = score + "/10";
  document.getElementById("percentLine").textContent = percent + "%";
  document.getElementById("wrongLine").textContent = (10 - score);
  document.getElementById("resultFill").style.width = percent + "%";
  
  const msg = grade === 1 ? "Hervorragend! Du bist ein echter Profi! 🌟" :
              grade === 2 ? "Sehr gut gemacht! Fast fehlerfrei! 👍" :
              grade === 3 ? "Gut gemacht! Du hast solides Wissen. 📚" :
              grade === 4 ? "Bestanden! Noch ein wenig üben und du wirst besser. 💡" :
              "Da ist noch Luft nach oben. Versuche es einfach noch einmal! 💪";
  document.getElementById("gradeMessage").textContent = msg;
  document.getElementById("resultSubtitle").textContent = "Dein Ergebnis wurde in deinem Browser gespeichert.";
  
  // Build review breakdown
  const revContainer = document.getElementById("reviewContainer");
  revContainer.innerHTML = "";
  t.questions.forEach((q, i) => {
    const box = el("div", "rule");
    box.innerHTML = `<b>Frage ${i+1}: ${q.q}</b><span>Erklärung: ${q.e}</span>`;
    revContainer.appendChild(box);
  });
  
  document.getElementById("result").style.display = "block";
  document.getElementById("result").scrollIntoView({ behavior: 'smooth' });
}

function restartTest() {
  startTest(currentTestIdx);
}

function goHome() {
  renderDashboard();
  document.getElementById("testView").classList.remove("active");
  document.getElementById("dashboard").classList.add("active");
  window.scrollTo({ top: 0, behavior: 'smooth' });
}

// Initial render on load
renderDashboard();
</script>
</body>
</html>

Game Source: DeutschCampus – Deine Lernplattform für Klasse 5–7

Creator: BlazeKoala99

Libraries: none

Complexity: complex (714 lines, 36.0 KB)

The full source code is displayed above on this page.

Remix Instructions

To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: pronomen-test-klasse-5-blazekoala99" to link back to the original. Then publish at arcadelab.ai/publish.