Skip to content

Commit 2ed90a2

Browse files
authored
Merge pull request #4646 from crazyserver/MOBILE-4842
Mobile 4842
2 parents 94df929 + 2af327d commit 2ed90a2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/addons/mod/quiz/components/index/addon-mod-quiz-index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<ion-list>
2626
<ion-item class="ion-text-wrap" *ngFor="let rule of accessRules">
2727
<ion-label>
28-
<p>{{ rule }}</p>
28+
<p class="item-heading">{{ rule }}</p>
2929
</ion-label>
3030
</ion-item>
3131
@if (gradeMethodReadable) {
@@ -36,13 +36,13 @@
3636
</ion-label>
3737
</ion-item>
3838
}
39-
@if (bestGrade && bestGrade.gradetopass && quiz && quiz.gradeFormatted) {
39+
@if (bestGrade && gradeToPass && quiz && quiz.gradeFormatted) {
4040
<ion-item class="ion-text-wrap">
4141
<ion-label>
4242
<p class="item-heading">{{ 'core.grades.gradepass' | translate }}</p>
4343
<p>{{ 'addon.mod_quiz.outof' | translate: { $a: {
44-
grade: bestGrade.gradetopass,
45-
maxgrade: quiz.gradeFormatted
44+
grade: gradeToPass,
45+
maxgrade: quiz.gradeFormatted
4646
} } }}</p>
4747
</ion-label>
4848
</ion-item>

src/addons/mod/quiz/components/index/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp
9696
showReviewColumn = false; // Whether to show the review column.
9797
attempts: QuizAttempt[] = []; // List of attempts the user has made.
9898
bestGrade?: AddonModQuizGetUserBestGradeWSResponse; // Best grade data.
99+
gradeToPass?: string; // Grade to pass.
99100
hasQuestions = false; // Whether the quiz has questions.
100101

101102
protected fetchContentDefaultError = 'addon.mod_quiz.errorgetquiz'; // Default error to show when loading contents.
@@ -259,6 +260,10 @@ export class AddonModQuizIndexComponent extends CoreCourseModuleMainActivityComp
259260
// Always get the best grade because it includes the grade to pass.
260261
this.bestGrade = await AddonModQuiz.getUserBestGrade(quiz.id, { cmId: this.module.id });
261262

263+
if (typeof this.bestGrade.gradetopass === 'number') {
264+
this.gradeToPass = AddonModQuiz.formatGrade(this.bestGrade.gradetopass, quiz.decimalpoints);
265+
}
266+
262267
// Get access information of last attempt (it also works if no attempts made).
263268
this.attemptAccessInfo = await AddonModQuiz.getAttemptAccessInformation(quiz.id, 0, { cmId: this.module.id });
264269

0 commit comments

Comments
 (0)