Skip to content

Commit

Permalink
Update resource selection to add a specific number of resources each …
Browse files Browse the repository at this point in the history
…time.

Tweak question replacement.
  • Loading branch information
rtibbles committed Jun 13, 2024
1 parent ec48e1a commit 90c2133
Show file tree
Hide file tree
Showing 11 changed files with 396 additions and 563 deletions.
1 change: 0 additions & 1 deletion kolibri/core/assets/src/exams/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export function convertExamQuestionSourcesV2toV3({ question_sources, learners_se
description: '',
questions,
learners_see_fixed_order,
question_count: questions.length,
},
];
}
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/assets/test/exams/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ describe('exam utils', () => {
description: '',
questions: expectedSources.sort(),
learners_see_fixed_order: true,
question_count: 3,
},
]);
});
Expand All @@ -164,7 +163,6 @@ describe('exam utils', () => {
description: '',
questions: expectedSources.sort(),
learners_see_fixed_order: false,
question_count: 3, // There are only 3 questions in the question_sources
},
]);
});
Expand Down
21 changes: 2 additions & 19 deletions kolibri/plugins/coach/assets/src/composables/quizCreationSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* within the `QuizSeciton.resource_pool` property.
* @property {string} id Unique ID for this exercise (aka, `exercise_id` elsewhere)
* @property {string} title The resource title
* @property {string} ancestor_id The ID of the parent contentnode
* @property {string} parent The ID of the parent contentnode
* @property {string} content_id The ID for the piece of content
* @property {bool} is_leaf Whether or not this is a leaf node (i.e. an exercise)
* @property {string} kind Exercise or Topic in our case - see: `ContentNodeKinds`
Expand All @@ -26,7 +26,7 @@ export const QuizExercise = {
type: String,
default: '',
},
ancestor_id: {
parent: {
type: String,
default: '',
},
Expand All @@ -46,10 +46,6 @@ export const QuizExercise = {
type: Object,
default: () => ({ assessment_item_ids: [] }),
},
contentnode: {
type: String,
default: '',
},
};

/**
Expand Down Expand Up @@ -89,15 +85,11 @@ export const QuizQuestion = {
* only used on the front-end
* @property {string} section_title The title of the quiz section
* @property {string} description A text blob associated with the section
* @property {number} question_count The number of questions in the section
* @property {QuizQuestion[]} questions The list of QuizQuestion objects in the
* section
* @property {boolean} learners_see_fixed_order A bool flag indicating whether this
* section is shown in the same order, or
* randomized, to the learners
* @property {QuizExercise[]} resource_pool An array of QuizExercise objects from
* which the questions in this section
* will be drawn
*/
export const QuizSection = {
section_id: {
Expand All @@ -117,19 +109,10 @@ export const QuizSection = {
default: () => [],
spec: QuizQuestion,
},
question_count: {
type: Number,
default: 10,
},
learners_see_fixed_order: {
type: Boolean,
default: false,
},
resource_pool: {
type: Array,
default: () => [],
spec: QuizExercise,
},
};

function getRandomInt() {
Expand Down
Loading

0 comments on commit 90c2133

Please sign in to comment.