This commit is contained in:
team3
2026-06-30 00:14:18 +02:00
parent 3e3559aa8f
commit c794fcaccf
152 changed files with 9485 additions and 9583 deletions

View File

@@ -1,12 +1,12 @@
// Geteilter Prüfungs-State pro Baustein.
// Die durablen Refs leben hier als Modul-Map: alle BausteinPanel-Instanzen desselben
// Bausteins nutzen DIESELBEN Refs. So überlebt der Verlauf das Remounten (Baustein-
// Wechsel, Fokus zu/auf) UND eine spät eintreffende Frage ist sofort reaktiv sichtbar.
// Geht bei Page-Reload verloren (Modul re-init) — bewusst kein DB-Aufwand.
// Shared exam state per block.
// The durable refs live here as a module map: all BlockPanel instances of the same
// block use the SAME refs. So the history survives remounting (block switch, focus
// open/close) AND a late-arriving question is immediately reactive and visible.
// Lost on page reload (module re-init) — deliberately no DB overhead.
import { ref } from 'vue'
const store = new Map() // key "topic::baustein" -> Refs (Verlauf + Fragen-Pool)
const store = new Map() // key "topic::block" -> refs (history + questions pool)
export function usePruefSlot(key) {
if (!store.has(key)) {
@@ -15,14 +15,14 @@ export function usePruefSlot(key) {
phase: ref('idle'),
aktuelleFrage: ref(''),
letztesFeedback: ref(''),
pool: ref([]), // vorformulierte Frage-Objekte der AKTUELLEN Form ({form, ...})
inflight: ref(0), // laufende Pool-Generierungen (instanzübergreifend koordiniert)
poolForm: ref(''), // Form, für die der Pool gefüllt ist — bei Wechsel leeren
musterQuelle: ref([]), // unveränderliche Voll-Liste der Frage-Muster (leer = Fallback)
musterPool: ref([]), // Arbeitskopie: gezogene Saat ohne Zurücklegen; leerReset
musterGeladen: ref(false), // Muster-Sidecar schon abgerufen?
quizAktuell: ref(null), // laufende Quiz-Frage {frage, optionen, gewaehlt, fertig, ...}
lueckAktuell: ref(null), // laufende Lückentext-Aufgabe {satz, loesung, ..., fertig}
pool: ref([]), // pre-built question objects of the CURRENT form ({form, ...})
inflight: ref(0), // running pool generations (coordinated across instances)
poolForm: ref(''), // form the pool is filled for — clear on switch
musterQuelle: ref([]), // immutable full list of question patterns (empty = fallback)
musterPool: ref([]), // working copy: drawn seed without replacement; emptyreset
musterGeladen: ref(false), // pattern sidecar already fetched?
quizAktuell: ref(null), // running quiz question {question, options, gewaehlt, done, ...}
lueckAktuell: ref(null), // running gap-text task {sentence, solution, ..., done}
})
}
return store.get(key)