Skip to content

Commit

Permalink
Merge pull request #12441 from AllanOXDi/EQM-missing-model
Browse files Browse the repository at this point in the history
fixes the route
  • Loading branch information
nucleogenesis authored Jul 12, 2024
2 parents c445798 + b88e65e commit 2fa688c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions kolibri/plugins/coach/assets/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CoachToolsModule extends KolibriApp {
PageNames.EXAM_CREATION_ROOT,
PageNames.QUIZ_SECTION_EDITOR,
PageNames.QUIZ_REPLACE_QUESTIONS,
PageNames.QUIZ_SELECT_PRACTICE_QUIZ,
PageNames.QUIZ_SELECT_RESOURCES,
PageNames.BOOK_MARKED_RESOURCES,
pages.ReportsQuizLearnerPage.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@
}
},
beforeRouteUpdate(to, from, next) {
if (
to.name === PageNames.QUIZ_SELECT_PRACTICE_QUIZ &&
from.name === PageNames.EXAM_CREATION_ROOT
) {
this.closeConfirmationToRoute = {
name: PageNames.EXAMS,
params: {
classId: to.params.classId,
},
};
next(false);
return;
}
if (to.params.sectionIndex >= this.allSections.length) {
next({
name: PageNames.EXAM_CREATION_ROOT,
Expand Down Expand Up @@ -287,6 +300,9 @@
}
this.quizInitialized = true;
},
destroy() {
window.removeEventListener('beforeunload', this.beforeUnload);
},
methods: {
beforeUnload(e) {
if (this.quizHasChanged) {
Expand Down

0 comments on commit 2fa688c

Please sign in to comment.