diff --git a/kolibri/plugins/coach/assets/src/composables/quizCreationSpecs.js b/kolibri/plugins/coach/assets/src/composables/quizCreationSpecs.js index bcd20b216d4..f827b4be6e6 100644 --- a/kolibri/plugins/coach/assets/src/composables/quizCreationSpecs.js +++ b/kolibri/plugins/coach/assets/src/composables/quizCreationSpecs.js @@ -180,4 +180,9 @@ export const Quiz = { type: Number, default: getRandomInt(), }, + // Default to sections being shown in a fixed order + learners_see_fixed_order: { + type: Boolean, + default: true, + }, }; diff --git a/kolibri/plugins/coach/assets/src/composables/useQuizCreation.js b/kolibri/plugins/coach/assets/src/composables/useQuizCreation.js index db84ccd1b98..74cbd546c74 100644 --- a/kolibri/plugins/coach/assets/src/composables/useQuizCreation.js +++ b/kolibri/plugins/coach/assets/src/composables/useQuizCreation.js @@ -25,6 +25,17 @@ function validateQuiz(quiz) { return validateObject(quiz, Quiz); } +const fieldsToSave = [ + 'title', + 'assignments', + 'learner_ids', + 'collection', + 'learners_see_fixed_order', + 'draft', + 'active', + 'archive', +]; + /** * Composable function presenting primary interface for Quiz Creation */ @@ -299,16 +310,17 @@ export default function useQuizCreation() { return Promise.reject(`Quiz is not valid: ${JSON.stringify(get(_quiz))}`); } - const id = get(_quiz).id; + const quizData = get(_quiz); + + const id = quizData.id; - const finalQuiz = { - title: get(_quiz).title, - assignments: get(_quiz).assignments, - learner_ids: get(_quiz).learner_ids, - collection: get(_quiz).collection, - }; + const finalQuiz = {}; + + for (const field of fieldsToSave) { + finalQuiz[field] = quizData[field]; + } - if (get(_quiz).draft) { + if (finalQuiz.draft) { // Here we update each section's `resource_pool` to only be the IDs of the resources const questionSourcesWithoutResourcePool = get(allSections).map(section => { const sectionToSave = { ...section }; diff --git a/kolibri/plugins/coach/assets/src/views/common/QuizStatus.vue b/kolibri/plugins/coach/assets/src/views/common/QuizStatus.vue index 577a8df71b1..7cc4653cfbf 100644 --- a/kolibri/plugins/coach/assets/src/views/common/QuizStatus.vue +++ b/kolibri/plugins/coach/assets/src/views/common/QuizStatus.vue @@ -162,7 +162,7 @@ :layout8="{ span: 4 }" :layout12="{ span: 12 }" > - {{ $tr('questionOrderLabel') }} + {{ sectionOrderLabel$() }} @@ -101,7 +101,7 @@ 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 ce2edea2e23..89e0c1d0aa5 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/index.vue @@ -27,6 +27,40 @@ @update="updateQuiz" /> +
+
+ {{ sectionOrderLabel$() }} +
+ + + + + + + + +
+ @@ -92,7 +126,15 @@ const showError = ref(false); const quizInitialized = ref(false); - const { saveAndClose$, allSectionsEmptyWarning$ } = enhancedQuizManagementStrings; + const { + saveAndClose$, + allSectionsEmptyWarning$, + sectionOrderLabel$, + randomizedLabel$, + fixedLabel$, + randomizedSectionOptionDescription$, + fixedSectionOptionDescription$, + } = enhancedQuizManagementStrings; return { classId, @@ -106,6 +148,11 @@ allSectionsEmpty, allSectionsEmptyWarning$, saveAndClose$, + sectionOrderLabel$, + randomizedLabel$, + fixedLabel$, + randomizedSectionOptionDescription$, + fixedSectionOptionDescription$, }; }, provide() { @@ -212,4 +259,9 @@ margin-right: 8px; } + .section-order-header { + margin-top: 0; + margin-bottom: 0.5em; + } + diff --git a/kolibri/plugins/coach/assets/src/views/plan/QuizSummaryPage/index.vue b/kolibri/plugins/coach/assets/src/views/plan/QuizSummaryPage/index.vue index a088c4b2597..1dd9cb40cfc 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/QuizSummaryPage/index.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/QuizSummaryPage/index.vue @@ -74,6 +74,7 @@ import CatchErrors from 'kolibri.utils.CatchErrors'; import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings'; import { ExamResource } from 'kolibri.resources'; + import { enhancedQuizManagementStrings } from 'kolibri-common/strings/enhancedQuizManagementStrings'; import { PageNames } from '../../../constants'; import commonCoach from '../../common'; import CoachAppBarPage from '../../CoachAppBarPage'; @@ -97,6 +98,16 @@ QuizOptionsDropdownMenu, }, mixins: [commonCoach, coachStringsMixin, commonCoreStrings], + setup() { + const { + randomizedSectionOptionDescription$, + fixedSectionOptionDescription$, + } = enhancedQuizManagementStrings; + return { + randomizedSectionOptionDescription$, + fixedSectionOptionDescription$, + }; + }, data() { return { quiz: { @@ -133,8 +144,8 @@ }, orderDescriptionString() { return this.quizIsRandomized - ? this.coachString('orderRandomDescription') - : this.coachString('orderFixedDescription'); + ? this.randomizedSectionOptionDescription$() + : this.fixedSectionOptionDescription$(); }, classId() { return this.$route.params.classId; diff --git a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizPreviewPage.vue b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizPreviewPage.vue index 991cb2fd977..c99dfa3a38d 100644 --- a/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizPreviewPage.vue +++ b/kolibri/plugins/coach/assets/src/views/reports/ReportsQuizPreviewPage.vue @@ -34,6 +34,7 @@