diff --git a/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts b/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts index 51a7adab560e8bca162a3e932ac0a61e1b4cb7fd..53a144abdf1e1c788b92cfc718beb2bcbf49460e 100644 --- a/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts +++ b/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts @@ -138,6 +138,11 @@ export class ContentChoiceCreatorComponent implements OnInit { } saveChanges(index: number, answer: DisplayAnswer, matDialogOutput: boolean) { + if (this.singleChoice) { + for (const option of this.content.options) { + option.points = -10; + } + } this.content.options[index].label = answer.answerOption.label; this.content.options[index].points = (answer.correct) ? 10 : -10; const indexInCorrectOptionIndexes = this.content.correctOptionIndexes.indexOf(index); @@ -238,13 +243,8 @@ export class ContentChoiceCreatorComponent implements OnInit { }); return; } - if (this.singleChoice) { - this.content.multiple = false; - this.content.format = ContentType.BINARY; - } else { - this.content.multiple = true; - this.content.format = ContentType.CHOICE; - } + this.content.multiple = !this.singleChoice; + this.content.format = ContentType.BINARY; let contentGroup: string; if (this.contentCol === 'Default') { contentGroup = ''; diff --git a/src/app/components/creator/content-yes-no-creator/content-yes-no-creator.component.ts b/src/app/components/creator/content-yes-no-creator/content-yes-no-creator.component.ts index 4baebb4d777a246af7e8fc0262e51357f1d9f91b..d55fa886359640e4600bf5e3cdcf5c9ecfe4fb29 100644 --- a/src/app/components/creator/content-yes-no-creator/content-yes-no-creator.component.ts +++ b/src/app/components/creator/content-yes-no-creator/content-yes-no-creator.component.ts @@ -79,8 +79,12 @@ export class ContentYesNoCreatorComponent implements OnInit { return; } if (this.yesno) { + this.content.options[0].points = 10; + this.content.options[1].points = -10; this.content.correctOptionIndexes = [0]; } else { + this.content.options[0].points = -10; + this.content.options[1].points = 10; this.content.correctOptionIndexes = [1]; } let contentGroup: string;