import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator';
import { Question } from 'src/assessment-evaluation/entities/entities-question-manager/question.entity';
import { CreateDto } from 'src/common/dto/create.dto';

export class CreateExamPaperDto extends CreateDto {
  @ApiProperty({ description: '试卷名称' })
  @IsNotEmpty({ message: '试卷名称不能为空' })
  title: string;

  @ApiProperty({ description: '试卷描述' })
  paperDesc: string;

  @ApiProperty({ description: '答题时长' })
  @IsNotEmpty({ message: '答题时长不能为空' })
  paperDuration: number;

  @ApiProperty({ description: '试卷总分' })
  @IsNotEmpty({ message: '试卷总分不能为空' })
  totalScore: number;

  @ApiProperty({ description: '试题数' })
  @IsNotEmpty({ message: '试题数不能为空' })
  questionCount: number;

  @ApiProperty({ description: '试卷分类' })
  @IsNotEmpty({ message: '试卷分类不能为空' })
  classifyId: number;

  @ApiProperty({ description: '及格分比例' })
  passPercent: number;

  @ApiProperty({ description: '试题是否乱序', default: 0 })
  questionsIsRandomSort: number;

  @ApiProperty({ description: '选项是否乱序', default: 0 })
  optionsIsRandomSort: number;

  @ApiProperty({ description: '试卷状态 0关闭 1开启', default: 0 })
  status: number;

  @ApiProperty({ description: '分享试卷 0关闭 1开启', default: 0 })
  share: number;

  @ApiProperty({ description: '是否为模拟考试 （0、1）', default: 0 })
  isPracticeExam: number;

  @ApiProperty({ description: '试卷中试题信息', default: 0 })
  questionInfo: {
    fixdQuestions: Question[];
    randQuestions: Question[];
  };
}
