feat: multi-profile system with Francesca and Sebastian curricula
- Add Profile enum (ISABELLA, FRANCESCA, SEBASTIAN) to Child model - Add ?profile= query param override to /api/curriculum/next - Pass profile prop from profile-specific pages to ExerciseSession - Fix curriculum import paths (engine uses @/curriculum/ alias) - Clear stale curriculumCache on dev reload - Fix self-referential prerequisites in Francesca etapa-1 - Fix prerequisite chains in Francesca etapa-2,3,4 and Sebastian etapa-2,3 - Add Francesca curriculum: 2-3 digit sums, subtractions, multiplications, short readings - Add Sebastian curriculum: 2-3 digit sums, interactive exercises, Argentine history, flags - All 44 E2E tests pass, TypeScript compiles cleanly
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
import type { Stage } from '../types'
|
||||
|
||||
function multIdx(a: number, b: number) {
|
||||
return (b - 2) * 4 + (a - 1)
|
||||
}
|
||||
|
||||
const mults = Array.from({ length: 12 }, (_, i) => {
|
||||
const a = (i % 4) + 1
|
||||
const b = Math.floor(i / 4) + 2
|
||||
return { a, b, res: a * b }
|
||||
})
|
||||
|
||||
const exercises: any[] = []
|
||||
|
||||
for (const m of mults) {
|
||||
const idx = multIdx(m.a, m.b)
|
||||
exercises.push({
|
||||
id: `fra4-mult-${m.a}-${m.b}`,
|
||||
stage: 4,
|
||||
skillCode: `mult-${m.a}x${m.b}`,
|
||||
type: 'eleccion',
|
||||
prerequisites: idx > 0 ? [`fra4-mult-${mults[idx - 1].a}-${mults[idx - 1].b}`] : [],
|
||||
content: {
|
||||
instruction: `Multiplicá: ${m.a} × ${m.b}`,
|
||||
audioText: `${m.a} veces ${m.b} es ${m.res}`,
|
||||
emoji: '✖️',
|
||||
options: [
|
||||
{ label: String(m.res), correct: true, id: String(m.res) },
|
||||
{ label: String(m.res + m.a), correct: false, id: `wrong-${m.a}a` },
|
||||
{ label: String(m.res + m.b), correct: false, id: `wrong-${m.b}a` },
|
||||
].sort(() => Math.random() - 0.5),
|
||||
},
|
||||
functionalContext: 'Multiplicar números de 1 dígito.',
|
||||
errorType: 'confusion-letra',
|
||||
})
|
||||
}
|
||||
|
||||
const lecturas = [
|
||||
{
|
||||
title: 'El sol',
|
||||
text: 'El sol brilla. Los niños juegan. Comen helado. Están contentos.',
|
||||
question: '¿Qué hacen los niños?',
|
||||
options: ['Juegan', 'Duermen', 'Estudian'],
|
||||
correcta: 'Juegan',
|
||||
emoji: '☀️',
|
||||
},
|
||||
{
|
||||
title: 'La merienda',
|
||||
text: 'Mamá prepara leche. Tomás come tostadas. ¡Qué rico!',
|
||||
question: '¿Qué prepara mamá?',
|
||||
options: ['Leche', 'Café', 'Agua'],
|
||||
correcta: 'Leche',
|
||||
emoji: '🥛',
|
||||
},
|
||||
{
|
||||
title: 'El parque',
|
||||
text: 'En el parque hay un árbol. Los pájaros cantan. Hace sol.',
|
||||
question: '¿Dónde están los pájaros?',
|
||||
options: ['En el parque', 'En el cielo', 'En casa'],
|
||||
correcta: 'En el parque',
|
||||
emoji: '🌳',
|
||||
},
|
||||
{
|
||||
title: 'La familia',
|
||||
text: 'Papá lee un libro. Mamá cocina. Los niños ayudan.',
|
||||
question: '¿Qué lee papá?',
|
||||
options: ['Un libro', 'El diario', 'Una carta'],
|
||||
correcta: 'Un libro',
|
||||
emoji: '📖',
|
||||
},
|
||||
{
|
||||
title: 'El río',
|
||||
text: 'El río corre. El pez nada. La rana salta.',
|
||||
question: '¿Qué hace la rana?',
|
||||
options: ['Salta', 'Nada', 'Vuela'],
|
||||
correcta: 'Salta',
|
||||
emoji: '🐸',
|
||||
},
|
||||
]
|
||||
|
||||
for (let i = 0; i < lecturas.length; i++) {
|
||||
const l = lecturas[i]
|
||||
exercises.push({
|
||||
id: `fra4-lectura-${i}`,
|
||||
stage: 4,
|
||||
skillCode: 'lectura-corta',
|
||||
type: 'lectura',
|
||||
prerequisites: i === 0 ? ['fra4-mult-1-2'] : [`fra4-lectura-${i - 1}`],
|
||||
content: {
|
||||
instruction: `Leé: ${l.title}`,
|
||||
text: l.text,
|
||||
audioText: l.text,
|
||||
emoji: l.emoji,
|
||||
options: l.options.map((o) => ({
|
||||
label: o,
|
||||
correct: o === l.correcta,
|
||||
id: o.toLowerCase().slice(0, 10),
|
||||
})),
|
||||
},
|
||||
functionalContext: 'Leer textos cortos con comprensión.',
|
||||
errorType: 'omision-letra',
|
||||
})
|
||||
}
|
||||
|
||||
const stage: Stage = {
|
||||
id: 4,
|
||||
name: 'Multiplicaciones y lecturas',
|
||||
description: 'Multiplicaciones de 1 dígito y lectura comprensiva de textos cortos.',
|
||||
exercises,
|
||||
}
|
||||
|
||||
export default stage
|
||||
Reference in New Issue
Block a user