From c53db7f5468373b721ac1767ebff630a25a8efe6 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 11 Mar 2024 15:33:35 +0100 Subject: [PATCH] MOBILE-4350 quiz: Fix submit navigation button --- .../mod/quiz/components/navigation-modal/navigation-modal.html | 2 +- .../mod/quiz/components/navigation-modal/navigation-modal.ts | 1 + src/addons/mod/quiz/pages/player/player.ts | 3 ++- src/addons/mod/quiz/pages/review/review.ts | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.html b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.html index 3af0aef3f..919ed509e 100644 --- a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.html +++ b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.html @@ -44,7 +44,7 @@ - + {{ 'addon.mod_quiz.finishattemptdots' | translate }} diff --git a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts index 614572a59..711ef23f8 100644 --- a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts +++ b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts @@ -28,6 +28,7 @@ export class AddonModQuizNavigationModalComponent { @Input() navigation?: AddonModQuizNavigationQuestion[]; // Whether the user is reviewing the attempt. @Input() summaryShown?: boolean; // Whether summary is currently being shown. + @Input() nextPage?: number; // Next page. @Input() currentPage?: number; // Current page. @Input() isReview?: boolean; // Whether the user is reviewing the attempt. @Input() isSequential?: boolean; // Whether quiz navigation is sequential. diff --git a/src/addons/mod/quiz/pages/player/player.ts b/src/addons/mod/quiz/pages/player/player.ts index 731dbeab5..8cb628905 100644 --- a/src/addons/mod/quiz/pages/player/player.ts +++ b/src/addons/mod/quiz/pages/player/player.ts @@ -273,7 +273,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave { return; } else if ( (page == this.attempt.currentpage && !this.showSummary) || - (fromModal && this.isSequential && page != this.attempt.currentpage) + (fromModal && this.isSequential && page != this.attempt.currentpage && page !== this.nextPage) ) { // If the user is navigating to the current page we do nothing. // Also, in sequential quizzes we can only navigate to the current page. @@ -733,6 +733,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave { navigation: this.navigation, summaryShown: this.showSummary, currentPage: this.attempt?.currentpage, + nextPage: this.nextPage, isReview: false, isSequential: this.isSequential, }, diff --git a/src/addons/mod/quiz/pages/review/review.ts b/src/addons/mod/quiz/pages/review/review.ts index 70f512c18..2532af09a 100644 --- a/src/addons/mod/quiz/pages/review/review.ts +++ b/src/addons/mod/quiz/pages/review/review.ts @@ -344,6 +344,7 @@ export class AddonModQuizReviewPage implements OnInit { navigation: this.navigation, summaryShown: false, currentPage: this.attempt?.currentpage, + nextPage: this.nextPage, isReview: true, isSequential: this.quiz && AddonModQuiz.isNavigationSequential(this.quiz), },