Skip to content

Commit

Permalink
Merge pull request #3966 from NoelDeMartin/MOBILE-4350
Browse files Browse the repository at this point in the history
MOBILE-4350 quiz: Fix submit navigation button
  • Loading branch information
dpalou authored Mar 12, 2024
2 parents f68a9b1 + c53db7f commit 04e6f6d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>{{ 'addon.mod_quiz.quiznavigation' | translate }}</h1>
</ion-content>
<ion-footer *ngIf="!isReview">
<!-- In player, show button to finish attempt. -->
<ion-button class="ion-text-wrap ion-margin" expand="block" (click)="loadPage(-1)">
<ion-button class="ion-text-wrap ion-margin" expand="block" (click)="loadPage(-1)" [disabled]="isSequential && nextPage !== -1">
{{ 'addon.mod_quiz.finishattemptdots' | translate }}
</ion-button>
</ion-footer>
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/addons/mod/quiz/pages/player/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
},
Expand Down
1 change: 1 addition & 0 deletions src/addons/mod/quiz/pages/review/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down

0 comments on commit 04e6f6d

Please sign in to comment.