Skip to content

Commit

Permalink
Merge pull request #4314 from dpalou/MOBILE-4707
Browse files Browse the repository at this point in the history
MOBILE-4707 quiz: Leave review page if not allowed to review
  • Loading branch information
crazyserver authored Feb 11, 2025
2 parents 7a3aa5e + 6654d6d commit 89ad349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/addons/mod/quiz/pages/review/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ export default class AddonModQuizReviewPage implements OnInit {
this.logView();
} catch (error) {
CoreAlerts.showError(error, { default: Translate.instant('addon.mod_quiz.errorgetquiz') });
if (error.errorcode === 'noreview' || error.errorcode === 'noreviewattempt') {
CoreNavigator.back();
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/addons/mod/quiz/services/quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ export class AddonModQuizProvider {
cacheKey: this.getAttemptReviewCacheKey(attemptId, page),
component: ADDON_MOD_QUIZ_COMPONENT,
componentId: options.cmId,
deleteCacheIfWSError: true,
...CoreSites.getReadingStrategyPreSets(options.readingStrategy), // Include reading strategy preSets.
};

Expand Down

0 comments on commit 89ad349

Please sign in to comment.