refactor(common): Question
This commit is contained in:
parent
d6b79dcced
commit
70a31a292c
6 changed files with 21 additions and 19 deletions
|
@ -1,15 +1,6 @@
|
|||
import { Question } from '../entities/questions/question.entity.js';
|
||||
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
|
||||
import { mapToStudentDTO } from './student.js';
|
||||
import { StudentDTO } from 'dwengo-1-common/src/interfaces/student';
|
||||
|
||||
export interface QuestionDTO {
|
||||
learningObjectIdentifier: LearningObjectIdentifier;
|
||||
sequenceNumber?: number;
|
||||
author: StudentDTO;
|
||||
timestamp?: string;
|
||||
content: string;
|
||||
}
|
||||
import { QuestionDTO, QuestionId } from 'dwengo-1-common/src/interfaces/question';
|
||||
|
||||
/**
|
||||
* Convert a Question entity to a DTO format.
|
||||
|
@ -30,11 +21,6 @@ export function mapToQuestionDTO(question: Question): QuestionDTO {
|
|||
};
|
||||
}
|
||||
|
||||
export interface QuestionId {
|
||||
learningObjectIdentifier: LearningObjectIdentifier;
|
||||
sequenceNumber: number;
|
||||
}
|
||||
|
||||
export function mapToQuestionId(question: QuestionDTO): QuestionId {
|
||||
return {
|
||||
learningObjectIdentifier: question.learningObjectIdentifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue