Skip to content

Commit

Permalink
Merge pull request #4206 from crazyserver/MOBILE-4616
Browse files Browse the repository at this point in the history
MOBILE-4616 quiz: Fix quiz navigation module icons
  • Loading branch information
dpalou authored Oct 11, 2024
2 parents 9814826 + 62f8040 commit 0e7a278
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ <h1>{{ 'addon.mod_quiz.quiznavigation' | translate }}</h1>
<ion-icon *ngIf="question.type === 'description' || !question.questionnumber" name="fas-circle-info" slot="end"
aria-hidden="true" />
<ion-icon *ngIf="question.stateClass === 'core-question-requiresgrading'" name="fas-circle-question"
[attr.aria-label]="question.status" slot="end" />
<ion-icon *ngIf="question.stateClass === 'core-question-correct'" name="fas-check" color="success"
[attr.aria-label]="question.status" slot="end" />
<ion-icon *ngIf="question.stateClass === 'core-question-partiallycorrect'" name="fas-square-check" color="warning"
[attr.aria-label]="question.status" slot="end" />
[title]="question.status" slot="end" />
<ion-icon *ngIf="question.stateClass === 'core-question-correct'" [name]="correctIcon" color="success"
[title]="question.status" slot="end" />
<ion-icon *ngIf="question.stateClass === 'core-question-partiallycorrect'" [name]="partialCorrectIcon" color="warning"
[title]="question.status" slot="end" />
<ion-icon *ngIf="question.stateClass === 'core-question-incorrect' ||
question.stateClass === 'core-question-notanswered'" name="fas-xmark" color="danger"
[attr.aria-label]="question.status" slot="end" />
question.stateClass === 'core-question-notanswered'" [name]="incorrectIcon" color="danger" [title]="question.status"
slot="end" />
</ion-item>
</ion-list>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

import { CoreSharedModule } from '@/core/shared.module';
import { toBoolean } from '@/core/transforms/boolean';
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';

import { CoreQuestionQuestionParsed } from '@features/question/services/question';
import { CoreQuestionHelper } from '@features/question/services/question-helper';
import { ModalController } from '@singletons';

/**
Expand All @@ -30,7 +31,7 @@ import { ModalController } from '@singletons';
CoreSharedModule,
],
})
export class AddonModQuizNavigationModalComponent {
export class AddonModQuizNavigationModalComponent implements OnInit {

@Input() navigation?: AddonModQuizNavigationQuestion[]; // Whether the user is reviewing the attempt.
@Input({ transform: toBoolean }) summaryShown = false; // Whether summary is currently being shown.
Expand All @@ -39,6 +40,19 @@ export class AddonModQuizNavigationModalComponent {
@Input({ transform: toBoolean }) isReview = false; // Whether the user is reviewing the attempt.
@Input({ transform: toBoolean }) isSequential = false; // Whether quiz navigation is sequential.

correctIcon = '';
incorrectIcon = '';
partialCorrectIcon = '';

/**
* @inheritdoc
*/
ngOnInit(): void {
this.correctIcon = CoreQuestionHelper.getCorrectIcon().fullName;
this.incorrectIcon = CoreQuestionHelper.getIncorrectIcon().fullName;
this.partialCorrectIcon = CoreQuestionHelper.getPartiallyCorrectIcon().fullName;
}

/**
* Close modal.
*/
Expand Down

0 comments on commit 0e7a278

Please sign in to comment.