diff --git a/kolibri/plugins/coach/assets/src/app.js b/kolibri/plugins/coach/assets/src/app.js index 42b84b6e3a1..8d7b5bd0efc 100644 --- a/kolibri/plugins/coach/assets/src/app.js +++ b/kolibri/plugins/coach/assets/src/app.js @@ -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, diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue index 05145d8d3df..047ba4db881 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue @@ -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, @@ -287,6 +300,9 @@ } this.quizInitialized = true; }, + destroy() { + window.removeEventListener('beforeunload', this.beforeUnload); + }, methods: { beforeUnload(e) { if (this.quizHasChanged) {