diff --git a/kolibri/plugins/coach/assets/src/routes/examRoutes.js b/kolibri/plugins/coach/assets/src/routes/examRoutes.js index 3e438dd6e74..ec43607cf6f 100644 --- a/kolibri/plugins/coach/assets/src/routes/examRoutes.js +++ b/kolibri/plugins/coach/assets/src/routes/examRoutes.js @@ -47,6 +47,9 @@ export default [ name: PageNames.EXAM_CREATION_ROOT, path: CLASS + QUIZ + '/edit/:sectionIndex', component: CreateExamPage, + meta: { + titleParts: [], + }, children: [ { name: PageNames.QUIZ_SECTION_EDITOR, diff --git a/kolibri/plugins/coach/assets/src/views/quizzes/QuizSummaryPage/index.vue b/kolibri/plugins/coach/assets/src/views/quizzes/QuizSummaryPage/index.vue index bfe3a541018..e4594d44404 100644 --- a/kolibri/plugins/coach/assets/src/views/quizzes/QuizSummaryPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/quizzes/QuizSummaryPage/index.vue @@ -79,7 +79,7 @@ { tab.to = this.classRoute( - this.group ? PageNames.GROUP_EXAM_SUMMARY : PageNames.EXAM_SUMMARY, + this.group ? this.PageNames.GROUP_EXAM_SUMMARY : this.PageNames.EXAM_SUMMARY, { tabId: tab.id }, ); }); @@ -260,8 +252,7 @@ methods: { // @public setData(data) { - const { exam, difficultQuestions } = data; - this.quiz = exam; + const { difficultQuestions } = data; this.difficultQuestions = difficultQuestions; this.loading = false; this.$store.dispatch('notLoading'); @@ -275,7 +266,7 @@ setCurrentAction(action) { if (action === 'EDIT_DETAILS') { this.$router.push({ - name: PageNames.EXAM_CREATION_ROOT, + name: this.PageNames.EXAM_CREATION_ROOT, params: { ...this.$route.params, sectionIndex: 0 }, }); } else { @@ -285,7 +276,7 @@ closeModal() { this.currentAction = ''; }, - handleSubmitCopy({ classroomId, groupIds, adHocLearnerIds, examTitle }) { + async handleSubmitCopy({ classroomId, groupIds, adHocLearnerIds, examTitle }) { const title = examTitle.trim().substring(0, 100).trim(); const assignments = serverAssignmentPayload(groupIds, classroomId); @@ -296,7 +287,8 @@ collection: classroomId, assignments, learner_ids: adHocLearnerIds, - question_sources: this.quiz.question_sources, + // This ensures backward compatibility for all question_sources versions + question_sources: (await convertExamQuestionSources(this.exam)).question_sources, }; ExamResource.saveModel({ data: newQuiz }) @@ -339,10 +331,10 @@ }); }, handleSubmitDelete() { - return deleteExam(this.quiz.id) + return deleteExam(this.quizId) .then(() => { - this.$store.commit('classSummary/DELETE_ITEM', { map: 'examMap', id: this.quiz.id }); - this.$router.replace(this.classRoute(PageNames.EXAMS_ROOT), () => { + this.$store.commit('classSummary/DELETE_ITEM', { map: 'examMap', id: this.quizId }); + this.$router.replace(this.classRoute(this.PageNames.EXAMS_ROOT), () => { this.showSnackbarNotification('quizDeleted'); }); }) @@ -351,7 +343,7 @@ }); }, detailLink(learnerId) { - return this.classRoute(PageNames.QUIZ_LEARNER_PAGE_ROOT, { + return this.classRoute(this.PageNames.QUIZ_LEARNER_PAGE_ROOT, { learnerId, }); },