Skip to content

Commit

Permalink
added information ob antrag abgelehnt/angenommen wurde... [see wahlbi…
Browse files Browse the repository at this point in the history
  • Loading branch information
binfalse committed Sep 4, 2017
1 parent 7cce182 commit 45b9313
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/quiz/quiz.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h4>Welche Partei hat am ähnlichsten wie du abgestimmt?</h4>

</tr>
<tr class="auswertung-detail" id="auswertung-complex-detail-{{q}}" *ngIf="complexDetails[q]">
<td class="w3-left-align w3-white w3-border-black w3-leftbar" colspan="6">
<td class="w3-left-align w3-border-black w3-leftbar w3-light-grey" colspan="6">
<div class="w3-margin-bottom">
<span class="q-context" [innerHTML]="quest.fragen[q].context"></span>
<strong class="q-question" [innerHTML]="quest.fragen[q].frage"></strong>
Expand All @@ -186,6 +186,7 @@ <h4>Welche Partei hat am ähnlichsten wie du abgestimmt?</h4>
</tr>
</ng-container>
</table>
<span [innerHTML]="questionResults[q]['gesamt']"></span>
</td>
</tr>
</ng-container>
Expand Down Expand Up @@ -267,6 +268,7 @@ <h4>Welche Partei hat am ähnlichsten wie du abgestimmt?</h4>
</tr>
</ng-container>
</table>
<span [innerHTML]="questionResults[q]['gesamt']"></span>
</td>
</tr>
</ng-container>
Expand Down
12 changes: 12 additions & 0 deletions src/app/quiz/quiz.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,25 @@ export class QuizComponent implements OnInit, AfterContentInit, AfterViewInit, A
}
this.questionResults[f] = curResults;
}

for (const opt of this.voteOptions) {
this.questionResults[f]['gesamt' + opt] = 0;
}

for (const party of this.parties) {
this.questionResults[f][party]["relevant"] = 0;
for (const opt of this.voteOptions) {
this.questionResults[f][party]["relevant"] += this.questionResults[f][party][opt];
this.questionResults[f]['gesamt' + opt] += this.questionResults[f][party][opt];
}
}

if (this.questionResults[f]['gesamtja'] > this.questionResults[f]['gesamtnein']) {
this.questionResults[f]['gesamt'] = "Vom Bundestag <strong>angenommen mit " + this.questionResults[f]['gesamtja'] + " Ja-Stimmen</strong> bei " + this.questionResults[f]['gesamtnein'] + " Nein-Stimmen und " + this.questionResults[f]['gesamtenthaltung'] + " Enthaltungen";
} else {
this.questionResults[f]['gesamt'] = "Vom Bundestag <strong>abgelehnt mit " + this.questionResults[f]['gesamtnein'] + " Nein-Stimmen</strong> bei " + this.questionResults[f]['gesamtja'] + " Ja-Stimmen und " + this.questionResults[f]['gesamtenthaltung'] + " Enthaltungen";
}

}
}
}
Expand Down

0 comments on commit 45b9313

Please sign in to comment.