From 58166e0e71cad6a11403748a0a595e69c14d353a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Tue, 4 Dec 2018 10:35:37 +0100 Subject: [PATCH] Rename functions --- .../shared/list-statistic/list-statistic.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/components/shared/list-statistic/list-statistic.component.ts b/src/app/components/shared/list-statistic/list-statistic.component.ts index a8f51b5fc..eae74da43 100644 --- a/src/app/components/shared/list-statistic/list-statistic.component.ts +++ b/src/app/components/shared/list-statistic/list-statistic.component.ts @@ -37,11 +37,11 @@ export class ListStatisticComponent implements OnInit { ngOnInit() { this.contentService.getContentChoiceByIds(this.contentGroup.contentIds).subscribe(contents => { - this.getContents(contents); + this.getData(contents); }); } - getContents(contents: ContentChoice[]) { + getData(contents: ContentChoice[]) { this.contents = contents; const length = contents.length; this.dataSource = new Array<ContentPercents>(length); @@ -50,7 +50,7 @@ export class ListStatisticComponent implements OnInit { this.dataSource[i].content = this.contents[i]; if (contents[i].format === ContentType.CHOICE) { this.contentService.getAnswer(contents[i].id).subscribe(answer => { - const percent = this.getCountCorrect(contents[i].options, answer.roundStatistics[0].independentCounts, contents[i].multiple); + const percent = this.evaluateStatistics(contents[i].options, answer.roundStatistics[0].independentCounts, contents[i].multiple); this.dataSource[i].percent = percent; if (percent >= 0) { console.log(percent); @@ -64,7 +64,7 @@ export class ListStatisticComponent implements OnInit { } } - getCountCorrect(options: AnswerOption[], indCounts: number[], multiple: boolean): number { + evaluateStatistics(options: AnswerOption[], indCounts: number[], multiple: boolean): number { this.correctCounts = 0; this.totalCounts = 0; const length = options.length; -- GitLab