export interface ExamSession {
  exam_id: number;
  title: string;
  sections: ExamSessionSection[];
  results_release_mode: "auto" | "manual_approval";
  total_time_min: number;
}

export interface ExamSessionSection {
  id: number;
  title: string;
  skill: string;
  time_limit_sec: number;
  questions: ExamQuestion[];
}

export interface ExamQuestion {
  id: number;
  type: string;
  stem: string;
  options?: { label: string; text: string }[];
  passage_text?: string;
  audio_url?: string;
  visual_url?: string;
  min_words?: number;
  marks: number;
}

export interface ExamAnswer {
  question_id: number;
  answer: string | string[] | null;
  flagged: boolean;
  time_spent_ms: number;
}

export interface ExamAutoSave {
  attempt_id?: number;
  section_id: number;
  answers: ExamAnswer[];
}

export interface SubmissionSummary {
  total_questions: number;
  answered: number;
  unanswered: number;
  flagged: number;
  sections: {
    id: number;
    title: string;
    answered: number;
    total: number;
    flagged: number;
  }[];
}

export interface ExamSubmitResponse {
  attempt_id: number;
  status: "submitted" | "scoring" | "scored";
  results_available: boolean;
}
