
# Conflicts: # backend/package.json # backend/src/config.ts # backend/src/controllers/learningObjects.ts # backend/src/controllers/learningPaths.ts # backend/src/data/content/attachment-repository.ts # backend/src/data/content/learning-object-repository.ts # backend/src/data/content/learning-path-repository.ts # backend/src/data/repositories.ts # backend/src/entities/content/learning-path.entity.ts # backend/src/exceptions.ts # backend/src/routes/learning-objects.ts # backend/src/services/learningObjects.ts # backend/src/services/learningPaths.ts # backend/src/util/apiHelper.ts # backend/src/util/envvars.ts # package-lock.json
33 lines
870 B
TypeScript
33 lines
870 B
TypeScript
import { Entity, Enum, ManyToOne, PrimaryKey, Property } from '@mikro-orm/core';
|
|
import { Language } from '../content/language.js';
|
|
import { Student } from '../users/student.entity.js';
|
|
import {QuestionRepository} from "../../data/questions/question-repository";
|
|
|
|
@Entity({repository: () => QuestionRepository})
|
|
export class Question {
|
|
@PrimaryKey({ type: 'string' })
|
|
learningObjectHruid!: string;
|
|
|
|
@Enum({
|
|
items: () => Language,
|
|
primary: true,
|
|
})
|
|
learningObjectLanguage!: Language;
|
|
|
|
@PrimaryKey({ type: 'string' })
|
|
learningObjectVersion: string = '1';
|
|
|
|
@PrimaryKey({ type: 'integer' })
|
|
sequenceNumber!: number;
|
|
|
|
@ManyToOne({
|
|
entity: () => Student,
|
|
})
|
|
author!: Student;
|
|
|
|
@Property({ type: 'datetime' })
|
|
timestamp: Date = new Date();
|
|
|
|
@Property({ type: 'text' })
|
|
content!: string;
|
|
}
|