From 71bdea69c6ea7b1a176f12132b39c4f3d5e06851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Fri, 1 Mar 2019 16:07:12 +0100 Subject: [PATCH] Implement skeleton for switch-bar-colors --- .../shared/statistic/statistic.component.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/components/shared/statistic/statistic.component.ts b/src/app/components/shared/statistic/statistic.component.ts index 2d7540624..964e71fb5 100644 --- a/src/app/components/shared/statistic/statistic.component.ts +++ b/src/app/components/shared/statistic/statistic.component.ts @@ -35,6 +35,8 @@ export class StatisticComponent implements OnInit { subject: string; maxLength: number; isLoading = true; + showsCorrect = false; + correctIndexes: number[]; constructor(protected route: ActivatedRoute, private contentService: ContentService, @@ -50,6 +52,7 @@ export class StatisticComponent implements OnInit { this.labels = new Array<string>(); this.answerList = new Array<AnswerList>(); this.data = new Array<number>(); + this.correctIndexes = new Array<number>(); this.route.params.subscribe(params => { this.contentId = params['contentId']; }); @@ -59,6 +62,22 @@ export class StatisticComponent implements OnInit { }); } + switchAnswers() { + if (this.showsCorrect === false) { + this.showCorrect(); + } else { + this.showNormal(); + } + } + + showCorrect() { + this.showsCorrect = true; + } + + showNormal() { + this.showsCorrect = false; + } + getData(content: ContentChoice) { this.subject = content.subject; const length = content.options.length; -- GitLab