Skip to content

Commit d666cb4

Browse files
committed
Fix schema inconsistency: ExerciseContentSchema now uses enum for correctAnswer
- Changed correctAnswer from z.string() to z.enum(['A', 'B', 'C', 'D']) - This ensures consistency with QuizDataSchema and GeneratedExerciseSchema - Should fix answer validation issues where AI generates string values - Addresses the root cause of incorrect answer marking
1 parent e56220d commit d666cb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/domain/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const ExerciseContentSchema = z.object({
8585
paragraph: z.string(),
8686
question: z.string(),
8787
options: z.object({ A: z.string(), B: z.string(), C: z.string(), D: z.string() }),
88-
correctAnswer: z.string(),
88+
correctAnswer: z.enum(['A', 'B', 'C', 'D']),
8989
allExplanations: z.object({
9090
A: z.string(),
9191
B: z.string(),

0 commit comments

Comments
 (0)