Skip to content
Snippets Groups Projects
Commit f1c40240 authored by Thomas Lenz's avatar Thomas Lenz
Browse files

Add text-content data model and implemented inheritance for choice-content

Add constructors for all contents
parent e7ba82e9
Branches
Tags
1 merge request!83Resolve "content types (classes)"
Pipeline #13404 passed with stage
in 33 seconds
export class AnswerOption {
constructor(label: string, points: string) {
this.label = label;
this.points = points;
}
label: string;
points: string;
}
import { AnswerOption } from './answer-option';
import { Content, Format } from './content';
export class ChoiceContent {
export class ChoiceContent extends Content {
constructor(roomId: string, subject: string, body: string, options: AnswerOption[], correctOptionIndexes: number[], multiple: boolean) {
super();
this.revision = '1';
this.roomId = roomId;
this.subject = subject;
this.body = body;
this.round = 1;
this.format = Format.CHOICE;
this.options = options;
this.correctOptionIndexes = correctOptionIndexes;
this.multiple = multiple;
}
options: AnswerOption[];
correctOtionIndexes: number[];
correctOptionIndexes: number[];
multiple: boolean;
}
import { Content, Format } from './content';
export class TextContent extends Content {
constructor(roomId: string, subject: string, body: string) {
super();
this.revision = '1';
this.roomId = roomId;
this.subject = subject;
this.body = body;
this.round = 1;
this.format = Format.TEXT;
this.formatAttributes.clear(); // API: formatAttributes = Map.empty();
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment