Merge pull request #3795 from NoelDeMartin/MOBILE-4383

MOBILE-4383 quiz: Disable offline sequential quiz
main
Dani Palou 2023-09-27 15:57:52 +02:00 committed by GitHub
commit 64be18b27a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -231,7 +231,7 @@ export class AddonModQuizPrefetchHandlerService extends CoreCourseActivityPrefet
const quiz = await AddonModQuiz.getQuiz(courseId, module.id, { siteId });
if (quiz.allowofflineattempts !== 1 || quiz.hasquestions === 0) {
if (!AddonModQuiz.isQuizOffline(quiz) || quiz.hasquestions === 0) {
return false;
}

View File

@ -1524,7 +1524,9 @@ export class AddonModQuizProvider {
*/
isQuizOffline(quiz: AddonModQuizQuizWSData): boolean {
// Don't allow downloading the quiz if offline is disabled to prevent wasting a lot of data when opening it.
return !!quiz.allowofflineattempts && !CoreSites.getCurrentSite()?.isOfflineDisabled();
return !!quiz.allowofflineattempts
&& !this.isNavigationSequential(quiz)
&& !CoreSites.getCurrentSite()?.isOfflineDisabled();
}
/**