From bc1abc2b7c185f15cb0babc2b8438552d3fda79e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Tue, 28 May 2019 13:13:58 +0200
Subject: [PATCH] Fix content choice creation

---
 .../content-choice-creator.component.ts            | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

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 51a7adab5..53a144abd 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 = '';
-- 
GitLab