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
+39
View File
@@ -0,0 +1,39 @@
import { NextRequest, NextResponse } from "next/server"
import { prisma } from "@/lib/db"
export async function POST(request: NextRequest) {
try {
const { childId, exerciseId, skillCode, correct, promptLevel, responseMs, errorType, stage } = await request.json()
if (!childId || !exerciseId || !skillCode) {
return NextResponse.json({ error: "Missing required fields" }, { status: 400 })
}
const sessionLog = await prisma.sessionLog.findFirst({
where: { childId },
orderBy: { startedAt: "desc" },
})
if (!sessionLog) {
return NextResponse.json({ error: "No active session" }, { status: 400 })
}
await prisma.skillAttempt.create({
data: {
sessionLogId: sessionLog.id,
skillCode,
promptLevel: promptLevel ?? 0,
correct,
responseMs: responseMs ?? null,
errorType: errorType ?? null,
exerciseId,
stage: stage ?? null,
},
})
return NextResponse.json({ success: true })
} catch (error) {
console.error("Curriculum grade error:", error)
return NextResponse.json({ error: "Internal error" }, { status: 500 })
}
}