export interface Metadata { attempt_id: string; total_possible_score: number; deduction: string; num_questions: number; name: string; start_time: Date; time_limit_minutes: number; } export interface MockMeta extends Metadata { test_id: string; } export interface SubjectMeta extends Metadata { subject_id: string; subject_name: string; } export interface TopicMeta extends Metadata { topic_id: string; topic_name: string; } export type Question = { question_id: string; question: string; options: string[]; type: string; }; export interface Test { metadata: Metadata; questions: Question[]; } type Answers = number | null; export interface TestAttempt { user_id: string; test_id: string; attempt_id: string; start_time: Date; end_time: Date; user_questions: { question_id: string; question: string; options: string[]; type: string; }; user_answers: Record; correct_answers: Record; correct_answers_count: number; wrong_answers_count: number; skipped_questions_count: number; } export interface ExamContextType { currentExam: Test | null; currentAttempt: TestAttempt | null; isHydrated: boolean; isInitialized: boolean; // Actions setCurrentExam: (exam: Test) => void; startExam: (exam?: Test) => void; setAnswer: (questionId: string, answer: Answers) => void; submitExam: () => TestAttempt | null; clearExam: () => void; setApiResponse: (response: any) => void; // Getters getAnswer: (questionId: string) => Answers; getProgress: () => number; isExamStarted: () => boolean; isExamCompleted: () => boolean; getApiResponse: () => any; }