diff --git a/src/app/answer-option.ts b/src/app/answer-option.ts index ce6c6e0ab1c83b395ce581e14b862594ada7816d..b8a1fefbf0122e24133737acb971b8af425cc817 100644 --- a/src/app/answer-option.ts +++ b/src/app/answer-option.ts @@ -1,4 +1,8 @@ export class AnswerOption { + constructor(label: string, points: string) { + this.label = label; + this.points = points; + } label: string; points: string; } diff --git a/src/app/choice-content.ts b/src/app/choice-content.ts index 74fc7a339e8af0157a89ad16b471064db088209a..27a4580fe77ab5c57a411c4d75d885cb6f51cc93 100644 --- a/src/app/choice-content.ts +++ b/src/app/choice-content.ts @@ -1,7 +1,20 @@ 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; } diff --git a/src/app/text-content.ts b/src/app/text-content.ts new file mode 100644 index 0000000000000000000000000000000000000000..363d19ea678f122e817f7e380c84dadfd91d43f9 --- /dev/null +++ b/src/app/text-content.ts @@ -0,0 +1,15 @@ +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(); + } +}