import { ApiProperty } from '@nestjs/swagger';
import { IsJSON } from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';

export class UpdateQuestionDto extends CreateDto {
  @ApiProperty({ description: '试题类型' })
  type: number;

  @ApiProperty({ description: '难易程度' })
  difficultyLevel: number;

  @ApiProperty({ description: '试题分类' })
  classifyId: number;

  @ApiProperty({ description: '试题题目' })
  title: string;

  @ApiProperty({ description: '试题选项' })
  @IsJSON({ message: '试题选项应为JSON格式' })
  options: string;

  @ApiProperty({ description: '正确答案' })
  @IsJSON({ message: '试题选项应为JSON格式' })
  answer: string;

  @ApiProperty({ description: '知识点ID' })
  knowledgeId: number;

  @ApiProperty({ description: '答案解析' })
  analysis: string;
  @ApiProperty({ description: '是否允许学员使用' })
  student: number;
}
