import { IncrementIdEntity } from 'src/common/entities/increment-id.entity';
import { Column, Entity } from 'typeorm';

/**
 * 试题表
 */
@Entity()
export class Question extends IncrementIdEntity {
  @Column({ comment: '试题类型（对应QuestionType表）' })
  type: number;

  @Column({
    name: 'difficulty_level',
    comment: '难易程度（对应QuestionDifficultyLevel',
  })
  difficultyLevel: number;

  @Column({ name: 'classify_id', comment: '试题分类', default: null })
  classifyId: number;

  @Column({ name: 'knowledge_id', comment: '知识点ID', default: null })
  knowledgeId: number;

  @Column({ comment: '试题题目' })
  title: string;

  @Column({ comment: '选项（json）', type: 'longtext' })
  options: string;

  @Column({ comment: '正确答案（json）', type: 'longtext' })
  answer: string;

  @Column({ comment: '答案解析', type: 'longtext' })
  analysis: string;

  @Column({ comment: '是否允许学员使用', default: 0 })
  student: number;
}
