diff --git a/kolibri/plugins/coach/assets/src/views/plan/CoachExamsPage/index.vue b/kolibri/plugins/coach/assets/src/views/plan/CoachExamsPage/index.vue index 5e224adcb85..7660bb47b3c 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CoachExamsPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CoachExamsPage/index.vue @@ -354,6 +354,11 @@ return '--'; }, }, + mounted() { + if (this.$route.query.snackbar) { + this.$store.dispatch('createSnackbar', this.$route.query.snackbar); + } + }, methods: { handleOpenQuiz(quizId) { const promise = ExamResource.saveModel({ diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue index c6b159f7a6c..c8416a71652 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue @@ -378,7 +378,6 @@ numberOfReplacementsAvailable$, sectionDeletedNotification$, deleteConfirmation$, - changesSavedSuccessfully$, questionsDeletedNotification$, expandAll$, collapseAll$, @@ -449,7 +448,6 @@ numberOfReplacementsAvailable$, sectionDeletedNotification$, deleteConfirmation$, - changesSavedSuccessfully$, questionsDeletedNotification$, toggleQuestionInSelection, @@ -574,10 +572,7 @@ } }, handleConfirmDelete() { - const section_title = displaySectionTitle( - this.activeSection.value, - this.activeSectionIndex.value, - ); + const section_title = displaySectionTitle(this.activeSection, this.activeSectionIndex); const newIndex = this.activeSectionIndex > 0 ? this.activeSectionIndex - 1 : 0; this.setActiveSection(newIndex); this.removeSection(this.activeSectionIndex); @@ -657,7 +652,6 @@ questions: newArray, }; this.updateSection(payload); - this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$()); this.dragActive = false; }, handleAddSection() { diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue index 9afd2ffe0ad..230af8c649e 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue @@ -263,7 +263,6 @@ numberOfSelectedBookmarks$, selectResourcesDescription$, questionsFromResources$, - changesSavedSuccessfully$, cannotSelectSomeTopicWarning$, closeConfirmationMessage$, closeConfirmationTitle$, @@ -662,7 +661,6 @@ cannotSelectSomeTopicWarning$, closeConfirmationMessage$, closeConfirmationTitle$, - changesSavedSuccessfully$, sectionSettings$, numberOfQuestionsSelected$, tooManyQuestions$, @@ -809,7 +807,6 @@ ...this.$route.params, }, }); - this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$()); }, // The message put onto the content's card when listed selectionMetadata(content) { diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue index 87560cc9865..9efc3458613 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue @@ -252,7 +252,6 @@ closeConfirmationMessage$, closeConfirmationTitle$, deleteConfirmation$, - changesSavedSuccessfully$, addQuestionsLabel$, addMoreQuestionsLabel$, sectionDeletedNotification$, @@ -401,7 +400,6 @@ currentSection$, deleteSectionLabel$, applySettings$, - changesSavedSuccessfully$, closeConfirmationTitle$, closeConfirmationMessage$, deleteConfirmation$, @@ -478,7 +476,7 @@ question_sources, }); } - this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$()); + this.$emit('closePanel'); }, }, }; 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 553e5dd36df..812d06e8707 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue @@ -142,6 +142,7 @@ allSectionsEmptyWarning$, closeConfirmationTitle$, closeConfirmationMessage$, + changesSavedSuccessfully$, sectionOrderLabel$, randomizedLabel$, fixedLabel$, @@ -165,6 +166,7 @@ allSectionsEmpty, allSectionsEmptyWarning$, saveAndClose$, + changesSavedSuccessfully$, sectionOrderLabel$, randomizedLabel$, fixedLabel$, @@ -238,12 +240,17 @@ saveQuizAndRedirect(close = true) { this.saveQuiz() .then(exam => { + this.$refs.detailsModal.handleSubmitSuccess(); + this.$store.dispatch('createSnackbar', this.changesSavedSuccessfully$()); if (close) { this.$router.replace({ name: PageNames.EXAMS, params: { classId: this.$route.params.classId, }, + query: { + snackbar: this.changesSavedSuccessfully$(), + }, }); } else { if (String(this.$route.params.quizId) === String(exam.id)) { diff --git a/kolibri/plugins/coach/assets/src/views/plan/assignments/AssignmentDetailsModal.vue b/kolibri/plugins/coach/assets/src/views/plan/assignments/AssignmentDetailsModal.vue index ac311f0324a..1b589ccd931 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/assignments/AssignmentDetailsModal.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/assignments/AssignmentDetailsModal.vue @@ -5,7 +5,8 @@ {{ submitErrorMessage }} @@ -319,6 +320,13 @@ // Scroll to the title field in case focus() didn't do that immediately window.scrollTo({ top: 0, behavior: 'smooth' }); }, + /** + * @public + */ + handleSubmitSuccess() { + this.showTitleError = false; + this.showServerError = false; + }, }, };