/** 题型编码（字典 tmsQuestionType） */
export type QuestionType = 'single' | 'multi' | 'judge' | 'blank' | 'essay';

/** 难度（字典 tmsDifficulty） */
export type Difficulty = 'easy' | 'normal' | 'hard';

/** 来源（字典 tmsQuestionSource） */
export type SourceType = 'self' | 'import' | 'external';

/** 状态（字典 tmsOpenClosedInvalid） */
export type QuestionStatus = 'open' | 'closed' | 'invalid';

export interface QuestionOption {
  id?: string;
  sortNo: number;
  optionLabel: string;
  optionContent: string;
  /** '1' 正确 / '0' 错误 */
  isCorrect: '0' | '1';
}

export interface QuestionEntity {
  id?: string;
  questionNo?: string;
  bankId: string;
  bankName?: string;
  questionType: QuestionType;
  difficulty?: Difficulty;
  sourceType?: SourceType;
  stem: string;
  analysis?: string;
  adminUserId?: string;
  adminUserName?: string;
  bizStatus: QuestionStatus;
  creatorTime?: string;
  options?: QuestionOption[];
  /** 填空：混杂模式批改 */
  blankMixMode?: boolean;
}

export interface QuestionPageQuery {
  currentPage?: number;
  pageSize?: number;
  bankId?: string;
  questionType?: QuestionType | '';
  bizStatus?: QuestionStatus | '';
  adminUserId?: string;
  keyword?: string;
}

export interface QuestionBankOption {
  id: string;
  fullName: string;
}

export interface QuestionFormModel {
  id?: string;
  questionType: QuestionType;
  bankId?: string;
  difficulty: Difficulty;
  sourceType: SourceType;
  bizStatus: QuestionStatus;
  stem: string;
  analysis: string;
  options: QuestionOption[];
  /** 判断题答案：true=正确 false=错误 */
  judgeAnswer?: boolean;
  /** 问答题参考答案 */
  essayAnswer?: string;
  /** 填空混杂批改 */
  blankMixMode: boolean;
}
