Skip to content
Snippets Groups Projects
Commit bc1abc2b authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Fix content choice creation

parent 4837ee58
1 merge request!186Resolve "Fix content creation"
...@@ -138,6 +138,11 @@ export class ContentChoiceCreatorComponent implements OnInit { ...@@ -138,6 +138,11 @@ export class ContentChoiceCreatorComponent implements OnInit {
} }
saveChanges(index: number, answer: DisplayAnswer, matDialogOutput: boolean) { 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].label = answer.answerOption.label;
this.content.options[index].points = (answer.correct) ? 10 : -10; this.content.options[index].points = (answer.correct) ? 10 : -10;
const indexInCorrectOptionIndexes = this.content.correctOptionIndexes.indexOf(index); const indexInCorrectOptionIndexes = this.content.correctOptionIndexes.indexOf(index);
...@@ -238,13 +243,8 @@ export class ContentChoiceCreatorComponent implements OnInit { ...@@ -238,13 +243,8 @@ export class ContentChoiceCreatorComponent implements OnInit {
}); });
return; return;
} }
if (this.singleChoice) { this.content.multiple = !this.singleChoice;
this.content.multiple = false; this.content.format = ContentType.BINARY;
this.content.format = ContentType.BINARY;
} else {
this.content.multiple = true;
this.content.format = ContentType.CHOICE;
}
let contentGroup: string; let contentGroup: string;
if (this.contentCol === 'Default') { if (this.contentCol === 'Default') {
contentGroup = ''; contentGroup = '';
......
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