feat: change scoring strategy

This commit is contained in:
2026-06-20 07:48:33 +03:30
parent 84b9267735
commit afb5045cf0
33 changed files with 634 additions and 34 deletions
@@ -12,6 +12,7 @@ import { QuestionType } from '../enums/question-type.enum';
import type { QuestionMetadata } from '../types/question-metadata.type';
import { Choice } from './choice.entity';
import { UNIQUE_TEST_ORDER_IDX } from '../constants';
import { QuestionRangeRule } from './question-range-rule.entity';
@Entity()
@Index(UNIQUE_TEST_ORDER_IDX, ['test', 'order'], { unique: true })
@@ -37,9 +38,15 @@ export class Question {
@Column({ type: 'int', nullable: false })
order!: number;
@Column({ type: 'int', default: 1 })
weight!: number;
@Column({ type: 'boolean', default: true })
required!: boolean;
@OneToMany(() => QuestionRangeRule, (rangeRule) => rangeRule.question)
rangeRules?: Array<QuestionRangeRule>;
@Column({ type: 'jsonb', nullable: true })
metadata!: QuestionMetadata;