File

apps/recallassess/recallassess-api/src/api/client/assessment/dto/submit-assessment.dto.ts

Index

Properties

Properties

answers
Type : SubmitAssessmentAnswerDto[]
Decorators :
@Expose()
@IsArray()
@ValidateNested({each: true})
@Type(undefined)
assessment_id
Type : number
Decorators :
@Expose()
@IsInt()
Optional assessment_type
Type : AssessmentType
Decorators :
@Expose()
@IsOptional()
@IsEnum(AssessmentType)
course_id
Type : number
Decorators :
@Expose()
@IsInt()
import { IsArray, IsEnum, IsInt, IsOptional, IsString, ValidateNested } from "class-validator";
import { Exclude, Expose, Type } from "class-transformer";
import { AssessmentType, BatAnswerLevel } from "@prisma/client";

@Exclude()
export class SubmitAssessmentAnswerDto {
  @Expose()
  @IsInt()
  assessment_question_id!: number;

  @Expose()
  @IsOptional()
  @IsInt()
  assessment_answer_id?: number;

  @Expose()
  @IsOptional()
  @IsString()
  answer_text?: string;

  @Expose()
  @IsOptional()
  answer_level?: BatAnswerLevel;
}

@Exclude()
export class SubmitAssessmentDto {
  @Expose()
  @IsInt()
  assessment_id!: number;

  @Expose()
  @IsInt()
  course_id!: number;

  @Expose()
  @IsOptional()
  @IsEnum(AssessmentType)
  assessment_type?: AssessmentType;

  @Expose()
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => SubmitAssessmentAnswerDto)
  answers!: SubmitAssessmentAnswerDto[];
}

results matching ""

    No results matching ""