Skip to content

Commit

Permalink
Don't show num assessments info for practice quiz selection.
Browse files Browse the repository at this point in the history
Ensure we don't show any topics without children, even if the unfiltered num assessments says otherwise.
  • Loading branch information
rtibbles committed Jun 14, 2024
1 parent dd6d48d commit 0dade88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
Expand Down

0 comments on commit 0dade88

Please sign in to comment.