MOBILE-4383 quiz: Disable offline sequential quiz

main
Noel De Martin 2023-09-27 14:30:18 +02:00
parent a666a07759
commit d15be4f539
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();
}
/**