This commit is contained in:
Team3
2026-06-07 12:18:07 +02:00
parent b414d7f464
commit 1649a046d2
4 changed files with 59 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ const props = defineProps({
projects: { type: Array, default: () => [] },
selectedTopic: { type: String, default: null },
stats: { type: Object, default: null },
fortschritt: { type: Object, default: () => ({}) },
doneByFormat: { type: Object, default: () => ({}) },
latestByFormat: { type: Object, default: () => ({}) },
allGuides: { type: Array, default: () => [] },
@@ -146,8 +147,10 @@ function handleFormatClick(format) {
}
}
// Lernschulden-Regel: JE Format max. 5 erstellte, aber nicht absolvierte Guides —
// darüber sind nur Neu-Generierungen bereits erstellter Guides erlaubt.
// Lernschulden-Regeln (nur Neu-Erstellungen; Resume + Neu-Generieren bestehender erlaubt):
// Progression pro Thema (MiniGuide → Guide → FullGuide) + max. 3 offene je Format.
const VORSTUFE = { Guide: 'MiniGuide', FullGuide: 'Guide' }
function offeneGuides(format) {
const f = props.stats?.formate?.[format]
return (f?.erstellt ?? 0) - (f?.absolviert ?? 0)
@@ -156,9 +159,14 @@ function offeneGuides(format) {
function playLock(format) {
if (format === 'OnePager') return null
if (!props.bausteine.ready) return 'Erst Bausteine erstellen'
if (props.doneByFormat[format] || abgebrochen(format)) return null
const vorstufe = VORSTUFE[format]
if (vorstufe && !props.fortschritt?.[vorstufe]) {
return `Erst den ${vorstufe} dieses Themas absolvieren`
}
const offen = offeneGuides(format)
if (offen >= 5 && !props.doneByFormat[format]) {
return `Erst ${format}s absolvieren — ${offen} offen (max. 5)`
if (offen >= 3) {
return `Erst ${format}s absolvieren — ${offen} offen (max. 3)`
}
return null
}