Adds indicator for correct question in the quiz results question viewer

parent 7ae472d4
......@@ -7,6 +7,7 @@
<div *ngFor="let elem of answers; let i = index">
<p class="d-flex align-items-center">
<span>{{normalizeAnswerIndex(i)}}:&nbsp;</span>
<span *ngIf="isCorrectAnswer(i)">({{'component.liveResults.correct_answer' | translate}})&nbsp;</span>
<span [innerHTML]="sanitizeHTML(elem)"></span>
</p>
</div>
......@@ -114,6 +114,10 @@ export class QuestionDetailsComponent implements OnInit, OnDestroy {
});
}
public isCorrectAnswer(index: number): boolean {
return this._question.answerOptionList[index].isCorrect;
}
public ngOnDestroy(): void {
this._subscriptions.forEach(sub => sub.unsubscribe());
}
......
Markdown is supported
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