File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy {
245245
246246 if ( info . preventaccessreasons && info . preventaccessreasons . length ) {
247247 // If it's a password protected lesson and we have the password, allow playing it.
248- const preventReason = this . lessonProvider . getPreventAccessReason ( info , ! ! this . password ) ;
248+ const preventReason = this . lessonProvider . getPreventAccessReason ( info , ! ! this . password , this . review ) ;
249249 if ( preventReason ) {
250250 // Lesson cannot be played, show message and go back.
251251 return Promise . reject ( preventReason . message ) ;
Original file line number Diff line number Diff line change @@ -2367,9 +2367,10 @@ export class AddonModLessonProvider {
23672367 *
23682368 * @param {any } info Lesson access info.
23692369 * @param {boolean } [ignorePassword] Whether password protected reason should be ignored (user already entered the password).
2370+ * @param {boolean } [isReview] Whether user is reviewing a retake.
23702371 * @return {any } Prevent access reason.
23712372 */
2372- getPreventAccessReason ( info : any , ignorePassword ?: boolean ) : any {
2373+ getPreventAccessReason ( info : any , ignorePassword ?: boolean , isReview ?: boolean ) : any {
23732374 let result ;
23742375
23752376 if ( info && info . preventaccessreasons ) {
@@ -2384,6 +2385,8 @@ export class AddonModLessonProvider {
23842385 // Treat password before all other reasons.
23852386 result = entry ;
23862387 }
2388+ } else if ( entry . reason == 'noretake' && isReview ) {
2389+ // Ignore noretake error when reviewing.
23872390 } else if ( ! result ) {
23882391 // Rest of cases, just return any of them.
23892392 result = entry ;
You can’t perform that action at this time.
0 commit comments