From 5b928247f6fb1a72465d3a7f8e3be01b1ec44fac Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Tue, 19 Dec 2023 11:51:44 -0800 Subject: [PATCH 1/4] section editor .value & local data definition fixes --- .../plan/CreateExamPage/SectionEditor.vue | 31 ++++++++++++------- package.json | 4 +-- 2 files changed, 21 insertions(+), 14 deletions(-) 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 b2fc665f922..8fd0986307c 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue @@ -175,7 +175,7 @@ :style="{ color: $themePalette.grey.v_700 }" >

{{ currentSection$() }} @@ -197,7 +197,7 @@ > + import { ref } from 'kolibri.lib.vueCompositionApi'; + import { get } from '@vueuse/core'; import { enhancedQuizManagementStrings } from 'kolibri-common/strings/enhancedQuizManagementStrings'; import useKResponsiveWindow from 'kolibri.coreVue.composables.useKResponsiveWindow'; import Draggable from 'kolibri.coreVue.components.Draggable'; @@ -264,15 +266,28 @@ deleteSection, } = injectQuizCreation(); + const selectedQuestionOrder = ref(get(activeSection).learners_see_fixed_order); + const numberOfQuestions = ref(get(activeSection).question_count); + const descriptionText = ref(get(activeSection).description); + const sectionTitle = ref(get(activeSection).section_title); + const { windowIsLarge, windowIsSmall } = useKResponsiveWindow(); return { + // useQuizCreation activeSection, allSections, updateSection, updateQuiz, deleteSection, + // Form models + selectedQuestionOrder, + numberOfQuestions, + descriptionText, + sectionTitle, + // Responsiveness windowIsLarge, windowIsSmall, + // i18n sectionSettings$, sectionTitle$, numberOfQuestionsLabel$, @@ -291,14 +306,6 @@ fixedOptionDescription$, }; }, - data() { - return { - selectedQuestionOrder: this.activeSection.value.learners_see_fixed_order, - numberOfQuestions: this.activeSection.value.question_count, - descriptionText: this.activeSection.value.description, - sectionTitle: this.activeSection.value.section_title, - }; - }, computed: { borderStyle() { return `border: 1px solid ${this.$themeTokens.fineLine}`; @@ -316,7 +323,7 @@ * @returns { QuizSection[] } */ sectionOrderList() { - return this.allSections.value; + return this.allSections; }, draggableStyle() { return { @@ -330,7 +337,7 @@ }, applySettings() { this.updateSection({ - section_id: this.activeSection.value.section_id, + section_id: this.activeSection.section_id, section_title: this.sectionTitle, description: this.descriptionText, question_count: this.numberOfQuestions, diff --git a/package.json b/package.json index 7ad6866acef..fa09dc73044 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "extends browserslist-config-kolibri" ], "volta": { - "node": "16.18.0" + "node": "16.18.0", + "yarn": "1.12.3" } } - From 3d0fb1d34e37e4154f28992a351765dc4bab25bc Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Tue, 19 Dec 2023 12:16:38 -0800 Subject: [PATCH 2/4] tab styles fixed - remove styles mistakenly kept during conflict resolution --- .../assets/src/views/plan/CreateExamPage/CreateQuizSection.vue | 1 - 1 file changed, 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 0742782b0a0..df8119895fe 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue @@ -43,7 +43,6 @@ tabsId="quizSectionTabs" class="section-tabs" :tabs="tabs" - :appearanceOverrides="{ padding: '0px', overflow: 'hidden' }" :activeTabId="activeSection ? activeSection.section_id : '' " From e2caa8e659b912860b23c69eea0c37ad2ee76fd9 Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Tue, 19 Dec 2023 12:28:08 -0800 Subject: [PATCH 3/4] re-apply styles for "no questions" view --- .../plan/CreateExamPage/CreateQuizSection.vue | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) 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 df8119895fe..9da48329a0b 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/CreateQuizSection.vue @@ -107,36 +107,39 @@ tabsId="quizSectionTabs" :activeTabId="activeSection ? activeSection.section_id : ''" > -

{{ activeSection.section_id }}

- -
- - + + - - - - - + + + + + +
+
?
-

+

{{ noQuestionsInSection$() }}

@@ -145,6 +148,7 @@ {{ addQuestionsLabel$() }} @@ -586,10 +590,11 @@ } .question-mark-layout { - align-items: center; width: 2.5em; height: 2.5em; margin: auto; + line-height: 1.7; + text-align: center; background-color: #dbc3d4; } @@ -599,10 +604,6 @@ color: #996189; } - .no-question-style { - font-weight: bold; - } - .kgrid-alignment-style { padding-right: 1em; padding-left: 0; From efb974aa9f1a4100bdb6dc5c3282806843d6fe85 Mon Sep 17 00:00:00 2001 From: Jacob Pierce Date: Wed, 20 Dec 2023 21:20:43 -0800 Subject: [PATCH 4/4] fix WARN: do not use v-for index as key in SectionEditor --- .../assets/src/views/plan/CreateExamPage/SectionEditor.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 8fd0986307c..378ae423dc6 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/SectionEditor.vue @@ -139,8 +139,8 @@ >