Skip to content
Snippets Groups Projects
Verified Commit 662c4cf2 authored by Lukas Maximilian Kimpel's avatar Lukas Maximilian Kimpel
Browse files

Refactor component to view choice content on participant side

parent 51d2a672
No related merge requests found
<div fxLayout="column" fxLayoutAlign="start" fxLayoutGap="20px" fxFill>
<div fxLayout="row" fxLayoutAlign="center">
<mat-card class="input-form">
<mat-card-header>
<mat-card-title>
<h3 class="subheading-2">{{ testChoiceContent.subject }}</h3>
</mat-card-title>
<mat-card-subtitle>
<div>
{{ testChoiceContent.body }}
</div>
</mat-card-subtitle>
</mat-card-header>
<mat-divider></mat-divider>
<mat-card-content>
<mat-list *ngFor="let answer of testChoiceContent.options">
<mat-checkbox color="primary">{{answer.label}}</mat-checkbox>
</mat-list>
</mat-card-content>
</mat-card>
</div>
</div>
<form>
<h1 class="mat-headline">{{ content.subject }}</h1>
<p>{{ content.body }}</p>
<mat-divider></mat-divider>
<mat-list>
<mat-list-item *ngFor="let answer of content.options">
<mat-checkbox color="primary">{{ answer.label }}</mat-checkbox>
</mat-list-item>
</mat-list>
<button mat-button>Send answer</button>
</form>
......@@ -8,15 +8,24 @@ import { AnswerOption } from '../answer-option';
styleUrls: ['./participant-choice-content.component.scss']
})
export class ParticipantChoiceContentComponent implements OnInit {
testAnswers = [
new AnswerOption('A - Giraffe', '0'),
new AnswerOption('B - Bär', '0'),
new AnswerOption('C - bra', '10')
];
testCorrectAnswers = [2];
testChoiceContent = new ChoiceContent(
'1', '1', '1', 'Tierkunde', 'Welches Tier ist schwarz mit weißen Streifen?', 1, this.testAnswers, this.testCorrectAnswers, false);
constructor() { }
content: ChoiceContent = new ChoiceContent('2',
'1',
'1',
'Choice Content 1',
'This is the body of Choice Content 1',
1,
[
new AnswerOption('Option 1', '0'),
new AnswerOption('Option 2', '10'),
new AnswerOption('Option 3', '20'),
new AnswerOption('Option 4', '30')
],
[2, 3, 4],
true);
constructor() {
}
ngOnInit() {
}
......
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