diff --git a/src/addon/mod/lesson/pages/player/player.ts b/src/addon/mod/lesson/pages/player/player.ts index c40f6ed8c..10e5e3ab0 100644 --- a/src/addon/mod/lesson/pages/player/player.ts +++ b/src/addon/mod/lesson/pages/player/player.ts @@ -245,7 +245,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy { if (info.preventaccessreasons && info.preventaccessreasons.length) { // If it's a password protected lesson and we have the password, allow playing it. - const preventReason = this.lessonProvider.getPreventAccessReason(info, !!this.password); + const preventReason = this.lessonProvider.getPreventAccessReason(info, !!this.password, this.review); if (preventReason) { // Lesson cannot be played, show message and go back. return Promise.reject(preventReason.message); diff --git a/src/addon/mod/lesson/providers/lesson.ts b/src/addon/mod/lesson/providers/lesson.ts index 5441b3f3a..a364d1693 100644 --- a/src/addon/mod/lesson/providers/lesson.ts +++ b/src/addon/mod/lesson/providers/lesson.ts @@ -2367,9 +2367,10 @@ export class AddonModLessonProvider { * * @param {any} info Lesson access info. * @param {boolean} [ignorePassword] Whether password protected reason should be ignored (user already entered the password). + * @param {boolean} [isReview] Whether user is reviewing a retake. * @return {any} Prevent access reason. */ - getPreventAccessReason(info: any, ignorePassword?: boolean): any { + getPreventAccessReason(info: any, ignorePassword?: boolean, isReview?: boolean): any { let result; if (info && info.preventaccessreasons) { @@ -2384,6 +2385,8 @@ export class AddonModLessonProvider { // Treat password before all other reasons. result = entry; } + } else if (entry.reason == 'noretake' && isReview) { + // Ignore noretake error when reviewing. } else if (!result) { // Rest of cases, just return any of them. result = entry;