From 4f6234676f367b0eb6bd6609995d55d4a892e2df Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Wed, 8 May 2024 01:03:13 +0300 Subject: [PATCH 1/2] Add Update resources option to Options dropdown --- .../views/plan/CreateExamPage/CreateQuizSection.vue | 11 +++++++++++ .../strings/enhancedQuizManagementStrings.js | 3 +++ 2 files changed, 14 insertions(+) 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 9f012363ede..4083bda4fdc 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue @@ -389,6 +389,7 @@ questionList$, sectionDeletedNotification$, deleteConfirmation$, + updateResources$, } = enhancedQuizManagementStrings; const { @@ -461,6 +462,7 @@ updateQuiz, addQuestionToSelection, removeQuestionFromSelection, + updateResources$, // Computed channels, @@ -532,6 +534,11 @@ icon: 'delete', id: 'delete', }, + { + label: this.updateResources$(), + icon: 'plus', + id: 'plus', + }, ]; }, }, @@ -566,6 +573,7 @@ handleActiveSectionAction(opt) { const section_id = this.activeSection.section_id; const editRoute = this.$router.getRoute(PageNames.QUIZ_SECTION_EDITOR, { section_id }); + const resourcesRoute = this.$router.getRoute(PageNames.QUIZ_SELECT_RESOURCES); switch (opt.label) { case this.editSectionLabel$(): this.$router.push(editRoute); @@ -573,6 +581,9 @@ case this.deleteSectionLabel$(): this.handleShowConfirmation(section_id); break; + case this.updateResources$(): + this.$router.push(resourcesRoute); + break; } }, tabRefLabel(section_id) { diff --git a/packages/kolibri-common/strings/enhancedQuizManagementStrings.js b/packages/kolibri-common/strings/enhancedQuizManagementStrings.js index a38b02058f1..9d3f5566c39 100644 --- a/packages/kolibri-common/strings/enhancedQuizManagementStrings.js +++ b/packages/kolibri-common/strings/enhancedQuizManagementStrings.js @@ -182,4 +182,7 @@ export const enhancedQuizManagementStrings = createTranslator('EnhancedQuizManag message: "Section '{ section_title }' deleted", context: 'A snackbar message that appears when the user deletes a section', }, + updateResources: { + message: 'Update resources', + }, }); From a300c42fff72b088c773c6fa529498e9b5cb1209 Mon Sep 17 00:00:00 2001 From: Allan Otodi Opeto <103313919+AllanOXDi@users.noreply.github.com> Date: Wed, 8 May 2024 22:37:21 +0300 Subject: [PATCH 2/2] fix the broken route --- .../src/views/plan/CreateExamPage/CreateQuizSection.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 4083bda4fdc..4f94615af02 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue @@ -573,7 +573,9 @@ handleActiveSectionAction(opt) { const section_id = this.activeSection.section_id; const editRoute = this.$router.getRoute(PageNames.QUIZ_SECTION_EDITOR, { section_id }); - const resourcesRoute = this.$router.getRoute(PageNames.QUIZ_SELECT_RESOURCES); + const resourcesRoute = this.$router.getRoute(PageNames.QUIZ_SELECT_RESOURCES, { + section_id, + }); switch (opt.label) { case this.editSectionLabel$(): this.$router.push(editRoute);