Skip to content

Commit

Permalink
MOBILE-4350 quiz: Allow navigating from sequential summary
Browse files Browse the repository at this point in the history
This is consistent with the LMS which has a "return to attempt" button. It also fixes the behaviour that users would expect, given that the buttons in the side navigation for the current page are not disabled in the summary.
  • Loading branch information
NoelDeMartin committed Feb 28, 2024
1 parent 41f2b36 commit b6278e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/addons/mod/quiz/pages/player/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,12 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
await this.scrollToQuestion(slot);

return;
} else if ((page == this.attempt.currentpage && !this.showSummary) || (fromModal && this.isSequential && page != -1)) {
} else if (
(page == this.attempt.currentpage && !this.showSummary) ||
(fromModal && this.isSequential && page != this.attempt.currentpage)
) {
// If the user is navigating to the current page we do nothing.
// Also, in sequential quizzes we don't allow navigating using the modal except for finishing the quiz (summary).
// Also, in sequential quizzes we can only navigate to the current page.
return;
} else if (page === -1 && this.showSummary) {
// Summary already shown.
Expand Down

0 comments on commit b6278e7

Please sign in to comment.