feat: add admin tests read and update endpoints
This commit is contained in:
@@ -14,35 +14,35 @@ import { Choice } from './choice.entity';
|
||||
@Entity()
|
||||
export class Question {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
id!: number;
|
||||
|
||||
@ManyToOne(() => Test, (test) => test.questions, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
test: Test;
|
||||
test!: Test;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: QuestionType,
|
||||
default: QuestionType.MULTI_CHOICE,
|
||||
})
|
||||
type: QuestionType;
|
||||
type!: QuestionType;
|
||||
|
||||
@Column({ type: 'text' })
|
||||
content: string;
|
||||
content!: string;
|
||||
|
||||
@Column({ type: 'int', nullable: false })
|
||||
order: number;
|
||||
order!: number;
|
||||
|
||||
@Column({ type: 'boolean', default: true })
|
||||
required: boolean;
|
||||
required!: boolean;
|
||||
|
||||
@Column({ type: 'jsonb', nullable: true })
|
||||
metadata: QuestionMetadata;
|
||||
metadata!: QuestionMetadata;
|
||||
|
||||
@OneToMany(() => Choice, (choice) => choice.question)
|
||||
choices?: Array<Choice>;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
createdAt!: Date;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user