export type CustomScoringMethod = "auto" | "rubric" | "mixed";

export interface CustomSection {
  title: string;
  skill?: string;
  question_count: number;
  time_limit_min?: number;
  scoring_method: CustomScoringMethod;
  sequence: number;
  question_ids: number[];
}

export interface CustomExamCreateRequest {
  title: string;
  subject_id: number;
  description?: string;
  total_time_min: number;
  pass_threshold?: number;
  results_release_mode: "auto" | "manual_approval";
  randomize: boolean;
  sections: CustomSection[];
}

export interface CustomExamConfig {
  id: number;
  title: string;
  subject_id: number;
  entity_id?: number;
  teacher_id?: number;
  description?: string;
  total_time_min: number;
  pass_threshold?: number;
  results_release_mode: "auto" | "manual_approval";
  randomize: boolean;
  status: "draft" | "published" | "archived";
  sections: CustomSection[];
}

export interface SaveAsTemplateRequest {
  name: string;
  structure: { sections: CustomSection[] };
  editable: true;
  type: "custom";
}
