feat: Puente Mayúscula-Minúscula + TTS SpeechSynthesis + E2E fixes

This commit is contained in:
renato97
2026-07-21 15:31:46 -03:00
commit fa8e0c58ce
120 changed files with 16013 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
"use client"
import { speak } from "@/lib/speech"
export interface CPAExerciseProps {
value: number
stage: "concrete" | "pictoric" | "abstract"
onCorrect: () => void
onIncorrect: () => void
}
export function generateCPAItems(value: number, stage: string): Array<{ emoji: string; id: number }> {
const pool = ["🍎", "🐱", "⭐", "🌸", "🎈", "🐶", "🍪", "🌈", "🦋", "🧸"]
return Array.from({ length: value }, (_, i) => ({
emoji: pool[i % pool.length],
id: i,
}))
}
export function speakCPAInstruction(value: number, stage: string) {
if (stage === "concrete") {
speak(`Tocá ${value} ${getItemName(value)}`)
} else if (stage === "pictoric") {
speak(`¿Cuántos hay? Señalá el número`)
} else {
speak(`¿Este número es el ${value}?`)
}
}
function getItemName(n: number): string {
if (n === 1) return "elemento"
return "elementos"
}