feat: EduEasy checkpoint - plan, scaffolding, pedagogia modules, components child+parent, API routes, Prisma schema, Docker infra, Better Auth

This commit is contained in:
Renato
2026-07-20 17:58:49 +02:00
commit e69b18abaa
49 changed files with 9842 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
export type CPAStage = "concrete" | "pictoric" | "abstract"
export interface CPAState {
stage: CPAStage
currentValue: number
attempts: number
mastered: boolean
}
/**
* CPA (Concrete-Pictórico-Abstracto) progression engine.
*
* - Concrete: show objects (animated) for the child to count with finger.
* - Pictoric: show images of objects, then hide them progressively.
* - Abstract: show only the number symbol → child says/selects the quantity.
*/
export function getCPAProgression(skillValue: number): CPAStage[] {
return ["concrete", "pictoric", "abstract"]
}
export function createCPAState(value: number): CPAState {
return {
stage: "concrete",
currentValue: value,
attempts: 0,
mastered: false,
}
}
export function advanceStage(state: CPAState): CPAState {
const stages: CPAStage[] = ["concrete", "pictoric", "abstract"]
const currentIdx = stages.indexOf(state.stage)
if (currentIdx < stages.length - 1) {
return { ...state, stage: stages[currentIdx + 1] }
}
return { ...state, mastered: true }
}