From d98059b71a4b5d3bc8f5b2e276a317605935555d Mon Sep 17 00:00:00 2001 From: Hagen <hagen.dressler@mni.thm.de> Date: Thu, 15 Mar 2018 11:02:00 +0100 Subject: [PATCH] Edit html component of answer statistic --- .../answer-statistics.component.html | 16 +++++----------- .../answer-statistics.component.ts | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/app/answer-statistics/answer-statistics.component.html b/src/app/answer-statistics/answer-statistics.component.html index 14103d3de..cbf02cdfb 100644 --- a/src/app/answer-statistics/answer-statistics.component.html +++ b/src/app/answer-statistics/answer-statistics.component.html @@ -7,17 +7,11 @@ {{ state.viewValue }} </mat-option> </mat-select> - <div *ngIf="selected == 1"> - <div *ngFor="let statistic of statistics"> - {{ statistic.name }} - <mat-progress-bar [value]="statistic.percent"> - </mat-progress-bar> - <div align="right"> Responded answers: {{ statistic.answers }} </div> - </div> - </div> - <div *ngIf="selected == 2"> - <!-- Add list of Question statistic --> - <!-- Need number of participants in room --> + <div *ngFor="let statistic of statistics"> + {{ statistic.name }} + <mat-progress-bar [value]="statistic.percent"> + </mat-progress-bar> + <div align="right"> Responded answers: {{ statistic.answers }} </div> </div> </mat-tab> <!-- Add second tab with true false answers --> diff --git a/src/app/answer-statistics/answer-statistics.component.ts b/src/app/answer-statistics/answer-statistics.component.ts index d78f23794..4113e0c98 100644 --- a/src/app/answer-statistics/answer-statistics.component.ts +++ b/src/app/answer-statistics/answer-statistics.component.ts @@ -56,7 +56,7 @@ export class AnswerStatisticsComponent implements OnInit { showStatistic(value) { /** refactor answer class structure for less code and more abstraction*/ this.statistics = []; for (const question of this.content) { - if (value === 1) { + if (value == 1) { const count = this.countTextAnswers(question.contentId); this.statistics.push({ name: question.subject, answers: count, percent: count * 100 / this.textAnswers.length, -- GitLab