Commit 89563042 authored by Christopher Fullarton's avatar Christopher Fullarton

Fixes console error when reloading the question details in a quiz flow

parent f1eb5252
......@@ -10,9 +10,9 @@
</ng-container>
<ng-container *ngIf="!answers?.length">
<h5>{{'component.answeroptions.ranged_question.min_range' | translate}}: {{getQuestionAsRanged()?.rangeMin}}</h5>
<h5>{{'component.answeroptions.ranged_question.correct_value' | translate}}: {{getQuestionAsRanged()?.correctValue}}</h5>
<h5>{{'component.answeroptions.ranged_question.max_range' | translate}}: {{getQuestionAsRanged()?.rangeMax}}</h5>
<h5>{{'component.answeroptions.ranged_question.min_range' | translate}}: {{getCurrentQuestionAsRanged()?.rangeMin}}</h5>
<h5>{{'component.answeroptions.ranged_question.correct_value' | translate}}: {{getCurrentQuestionAsRanged()?.correctValue}}</h5>
<h5>{{'component.answeroptions.ranged_question.max_range' | translate}}: {{getCurrentQuestionAsRanged()?.rangeMax}}</h5>
</ng-container>
<ng-template #defaultAnswerView>
......
......@@ -141,7 +141,11 @@ export class QuestionDetailsComponent implements OnInit, OnDestroy {
this._destroy.complete();
}
public getQuestionAsRanged(): RangedQuestionEntity {
public getCurrentQuestionAsRanged(): RangedQuestionEntity {
if (!this.quizService.quiz) {
return;
}
return this.quizService.quiz.questionList[this.questionIndex] as RangedQuestionEntity;
}
......
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