diff --git a/kolibri/plugins/coach/assets/src/composables/useQuizResources.js b/kolibri/plugins/coach/assets/src/composables/useQuizResources.js index 7951d569a5e..58203edcc53 100644 --- a/kolibri/plugins/coach/assets/src/composables/useQuizResources.js +++ b/kolibri/plugins/coach/assets/src/composables/useQuizResources.js @@ -67,6 +67,13 @@ export default function useQuizResources({ topicId, practiceQuiz = false } = {}) // return null so we can easily filter after return null; } + if (node.kind === ContentNodeKinds.TOPIC && !node.children) { + // If the topic has no children, we can assume it has no assessments + // Only do this check for topics, because CHANNEL kinds are normally + // ChannelMetadata objects masquerading as ContentNode objects + // and so don't have children + return null; + } node.num_assessments = topicsWithAssessmentCountsMap[node.id]; } return node; diff --git a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue index 20747af234f..c641f1c61bb 100644 --- a/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue +++ b/kolibri/plugins/coach/assets/src/views/plan/CreateExamPage/ResourceSelection.vue @@ -730,7 +730,7 @@ }, methods: { cardNoticeContent(content) { - if (content.kind === ContentNodeKinds.EXERCISE) { + if (!this.selectPracticeQuiz && content.kind === ContentNodeKinds.EXERCISE) { return this.questionsUnusedInSection$({ count: this.unusedQuestionsCount(content), });