This commit is contained in:
team3
2026-06-24 07:52:05 +02:00
parent 12125d0f2d
commit 3b1e84e17d
13 changed files with 46 additions and 224 deletions

View File

@@ -17,7 +17,7 @@ const props = defineProps({
import { computed, onMounted, onUnmounted, ref } from 'vue'
const emit = defineEmits(['close', 'prev', 'next', 'statusChanged', 'setAnsicht'])
const emit = defineEmits(['close', 'prev', 'next', 'statusChanged', 'setAnsicht', 'openSidebar'])
const guideEl = ref(null) // linke Guide-Spalte (Scroll-Ziel für ALT+↑/↓)
const rightEl = ref(null) // rechte Spalte (Prüfungs-Panel mit Eingabefeld)
@@ -72,6 +72,7 @@ const standFarbe = computed(() => {
<div class="fokus-overlay" :style="{ '--stand': standFarbe }">
<div class="fokus-bar">
<div class="fokus-bar-inner">
<button class="fokus-btn" title="Navigation öffnen" @click="$emit('openSidebar')"></button>
<button class="fokus-btn" :disabled="!hasPrev" title="Voriger Baustein" @click="$emit('prev')"></button>
<button class="fokus-btn" :disabled="!hasNext" title="Nächster Baustein" @click="$emit('next')"></button>
<span class="fokus-titel">{{ baustein.title }}</span>

View File

@@ -28,8 +28,8 @@ const VERSTANDEN = 12
const GEMEISTERT = 18
const VOLL = 30
const st = computed(() => props.status || { gute_antworten: 0, streak: 0, absolviert: false, verstanden: false, gemeistert: false })
// Aktiver Modus aus Score-Band (unter 30 fix) + Schwierigkeit (ALT+E). Ab 30 frei.
// Ohne Frage-Muster (alter Baustein) gibt es nur Erklären — Quiz/Lückentext brauchen die Saat.
// Volle Prüfung (cap 30): durchgehend zufällig aus allen 5 Formen. Kurze Prüfung (cap 6):
// Score-Band + Schwierigkeit (ALT+E). Ohne Frage-Muster (alter Baustein) nur Erklären.
const MODI = ['quiz_leicht', 'quiz_schwer', 'lueck_leicht', 'lueck_schwer', 'erklaeren']
const score = computed(() => st.value.gute_antworten || 0)
const schwerWahl = ref(false) // leicht/schwer in den Bändern unter 19 (ALT+E)
@@ -42,9 +42,13 @@ function bandFuer(s) {
}
// Am Format-Max: Score eingefroren („Max"). Gilt auch bei cap 30 (FullGuide, endgültig).
const amDeckel = computed(() => score.value >= props.cap)
// Aktuelles Band: am Deckel bleibt das Band des erreichten Formats (cap1), sonst score-basiert.
// Aktuelles Band: volle Prüfung (cap 30) ist DURCHGEHEND zufällig aus allen 5 Formen.
// Sonst score-basiert (am Deckel das Band des erreichten Formats, cap1).
// Ohne Frage-Muster (alter Baustein) gibt es nur Erklären.
const aktuellesBand = computed(() => musterModus.value ? bandFuer(amDeckel.value ? props.cap - 1 : score.value) : 'erklaeren')
const aktuellesBand = computed(() =>
!musterModus.value ? 'erklaeren'
: props.cap >= VOLL ? 'zufall'
: bandFuer(amDeckel.value ? props.cap - 1 : score.value))
// 'zufall' = Platzhalter; das gezogene Objekt trägt die echte Form/Schwierigkeit.
const aktiverModus = computed(() => {
const b = aktuellesBand.value
@@ -74,10 +78,10 @@ const aktSchwer = computed(() => {
return schwer.value
})
const modusRegel = computed(() => {
const m = imZufall.value ? '3' : '1' // Zufallband: Fehler kostet 3
const m = score.value >= GEMEISTERT ? '3' : '1' // Fehler kostet erst ab Score 18 3
if (zeigeForm.value === 'quiz') return aktSchwer.value ? `x von 4 · +3/${m}` : `1 von 4 · +1/${m}`
if (zeigeForm.value === 'lueckentext') return aktSchwer.value ? `frei tippen · +3/${m}` : `Begriff aus 4 · +1/${m}`
return imZufall.value ? '+1/+2/+3 · Fehler 3' : '+1/+2/+3 · Nachfragen max +1 · schwach 1'
return score.value >= GEMEISTERT ? '+1/+2/+3 · Fehler 3' : '+1/+2/+3 · Nachfragen max +1 · schwach 1'
})
// Ende des aktuellen Bands (nächster Meilenstein).
const bandZiel = computed(() => {
@@ -689,7 +693,9 @@ function onPruefKey(e) {
<div v-else>
<p class="bp-hint">
<template v-if="amDeckel">{{ FORM_NAME[zeigeForm] }} · {{ score }}/{{ cap }} <strong>Max</strong>.</template>
<template v-else>{{ FORM_NAME[zeigeForm] }} · {{ score }}/{{ bandZiel }} · {{ modusRegel }}<span v-if="imZufall" class="bp-hint-key"> · zufällig</span></template>
<template v-else-if="imZufall && !anzeigeForm">Zufällig · {{ score }}/{{ cap }}</template>
<template v-else-if="imZufall">{{ FORM_NAME[zeigeForm] }} · {{ score }}/{{ cap }} · {{ modusRegel }}</template>
<template v-else>{{ FORM_NAME[zeigeForm] }} · {{ score }}/{{ bandZiel }} · {{ modusRegel }}</template>
</p>
<button
v-if="!amDeckel && !imZufall && zeigeForm !== 'erklaeren'"

View File

@@ -16,7 +16,7 @@ const props = defineProps({
ansichtModus: { type: String, default: 'kompakt' }, // kompakt | erklärend
})
const emit = defineEmits(['progressChanged', 'setAnsicht'])
const emit = defineEmits(['progressChanged', 'setAnsicht', 'openSidebar', 'fokusActive'])
// Rotierende Kapitel-Akzentfarben (ohne Rot)
const CH_COLORS = ['#3b82f6', '#8b5cf6', '#14b8a6', '#f59e0b', '#22c55e', '#6366f1']
@@ -97,6 +97,10 @@ const bausteine = computed(() =>
)
const fokusBaustein = computed(() => (fokusIndex.value === null ? null : bausteine.value[fokusIndex.value]))
// Fokus-Zustand an App melden (für die Sidebar über dem Overlay); Themenwechsel schließt den Fokus.
watch(fokusIndex, (v) => emit('fokusActive', v !== null))
watch(() => props.previewGuide?.id, () => { fokusIndex.value = null })
function openFokus(baustein, tab) {
if (!istPruefbar(baustein)) return // reine Lese-Sections (Rest/Rand) öffnen keinen Prüfungs-Fokus
const i = bausteine.value.findIndex((s) => s.title === baustein.title)
@@ -286,6 +290,7 @@ function extractContext() {
@close="fokusIndex = null"
@set-ansicht="$emit('setAnsicht', $event)"
@status-changed="(st) => onBausteinStatus(st.baustein, st)"
@open-sidebar="$emit('openSidebar')"
/>
<button v-if="previewGuide && !chatOpen && fokusIndex === null" class="chat-fab" :class="{ shifted: elementsOpen }" title="Fragen zum Guide" @click="openChat">💬</button>