File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/addons/mod/quiz/components/index Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 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) {
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 >
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments