diff --git a/core/domain/learner_progress_services.py b/core/domain/learner_progress_services.py index e0510aa1c564..cfdf474ed6bf 100644 --- a/core/domain/learner_progress_services.py +++ b/core/domain/learner_progress_services.py @@ -1728,7 +1728,16 @@ def get_displayable_untracked_topic_summary_dicts( ] = collections.defaultdict(list) topic_ids = [topic.id for topic in untracked_topic_summaries] topics = topic_fetchers.get_topics_by_ids(topic_ids, strict=True) + classrooms = classroom_config_services.get_all_classrooms() + published_classroom_topic_ids = [ + topic_id + for classroom in classrooms if classroom.is_published + for topic_id in classroom.topic_id_to_prerequisite_topic_ids.keys() + ] + for index, topic in enumerate(topics): + if topic.id not in published_classroom_topic_ids: + continue all_skill_ids = topic.get_all_skill_ids() skill_descriptions = ( skill_services.get_descriptions_of_skills( diff --git a/core/domain/learner_progress_services_test.py b/core/domain/learner_progress_services_test.py index c884a8d771f5..0bc39f8825e8 100644 --- a/core/domain/learner_progress_services_test.py +++ b/core/domain/learner_progress_services_test.py @@ -1602,6 +1602,12 @@ def test_get_all_and_untracked_topic_ids(self) -> None: self.TOPIC_ID_1: [] } ) + self.save_new_valid_classroom( + is_published=False, + name='History', + url_fragment='history', + classroom_id='historyid' + ) self.login(self.USER_EMAIL) partially_learnt_topic_ids = ( @@ -1655,6 +1661,14 @@ def test_get_all_and_untracked_topic_ids(self) -> None: learner_progress_services.get_all_and_untracked_topic_ids_for_user( partially_learnt_topic_ids, learnt_topic_ids, topic_ids_to_learn)) + untracked_topic_summary_dicts = ( + learner_progress_services + .get_displayable_untracked_topic_summary_dicts( + self.user_id, + topic_fetchers.get_all_topic_summaries() + ) + ) + self.assertEqual(len(untracked_topic_summary_dicts), 1) self.assertEqual(len(all_topics), 2) self.assertEqual(len(untracked_topics), 0) diff --git a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html index d94af7a54352..ffc29058b1a2 100644 --- a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html +++ b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html @@ -10,19 +10,17 @@
{{ 'I18N_CLASSROOM_NAVIGATION_LINKS_DESCRIPTION' | translate }}