We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Show skill mastery values in the topic viewer
Add a skill tab in the topic viewer that will show skill mastery of all skills in that topic (Once we have enough skill mastery information for the skill)

Milestone 3.2 in @sophiewu6 's GSoC project

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `core/controllers/topic_viewer.py`
Content:
```
1 # Copyright 2018 The Oppia Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS-IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 """Controllers for the topic viewer page."""
16 
17 from constants import constants
18 from core.controllers import acl_decorators
19 from core.controllers import base
20 from core.domain import story_fetchers
21 from core.domain import topic_fetchers
22 import feconf
23 
24 
25 class TopicViewerPage(base.BaseHandler):
26     """Renders the topic viewer page."""
27 
28     @acl_decorators.can_access_topic_viewer_page
29     def get(self, _):
30         """Handles GET requests."""
31 
32         if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:
33             raise self.PageNotFoundException
34 
35         self.render_template('dist/topic-viewer-page.mainpage.html')
36 
37 
38 class TopicPageDataHandler(base.BaseHandler):
39     """Manages the data that needs to be displayed to a learner on the topic
40     viewer page.
41     """
42     GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON
43 
44     @acl_decorators.can_access_topic_viewer_page
45     def get(self, topic_name):
46         """Handles GET requests."""
47 
48         if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:
49             raise self.PageNotFoundException
50 
51         topic = topic_fetchers.get_topic_by_name(topic_name)
52         canonical_story_ids = topic.get_canonical_story_ids(
53             include_only_published=True)
54         additional_story_ids = topic.get_additional_story_ids(
55             include_only_published=True)
56         canonical_story_summaries = [
57             story_fetchers.get_story_summary_by_id(
58                 canonical_story_id) for canonical_story_id
59             in canonical_story_ids]
60 
61         additional_story_summaries = [
62             story_fetchers.get_story_summary_by_id(
63                 additional_story_id) for additional_story_id
64             in additional_story_ids]
65 
66         canonical_story_dicts = [
67             summary.to_human_readable_dict() for summary
68             in canonical_story_summaries]
69 
70         additional_story_dicts = [
71             summary.to_human_readable_dict() for summary
72             in additional_story_summaries]
73 
74         uncategorized_skill_ids = topic.get_all_uncategorized_skill_ids()
75         subtopics = topic.get_all_subtopics()
76 
77         self.values.update({
78             'topic_id': topic.id,
79             'topic_name': topic.name,
80             'canonical_story_dicts': canonical_story_dicts,
81             'additional_story_dicts': additional_story_dicts,
82             'uncategorized_skill_ids': uncategorized_skill_ids,
83             'subtopics': subtopics
84         })
85         self.render_json(self.values)
86
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/core/controllers/topic_viewer.py b/core/controllers/topic_viewer.py
--- a/core/controllers/topic_viewer.py
+++ b/core/controllers/topic_viewer.py
@@ -17,6 +17,7 @@
 from constants import constants
 from core.controllers import acl_decorators
 from core.controllers import base
+from core.domain import skill_services
 from core.domain import story_fetchers
 from core.domain import topic_fetchers
 import feconf
@@ -74,12 +75,26 @@
         uncategorized_skill_ids = topic.get_all_uncategorized_skill_ids()
         subtopics = topic.get_all_subtopics()
 
+        assigned_skill_ids = topic.get_all_skill_ids()
+        skill_descriptions = skill_services.get_skill_descriptions_by_ids(
+            topic.id, assigned_skill_ids)
+
+        if self.user_id:
+            degrees_of_mastery = skill_services.get_multi_user_skill_mastery(
+                self.user_id, assigned_skill_ids)
+        else:
+            degrees_of_mastery = {}
+            for skill_id in assigned_skill_ids:
+                degrees_of_mastery[skill_id] = None
+
         self.values.update({
             'topic_id': topic.id,
             'topic_name': topic.name,
             'canonical_story_dicts': canonical_story_dicts,
             'additional_story_dicts': additional_story_dicts,
             'uncategorized_skill_ids': uncategorized_skill_ids,
-            'subtopics': subtopics
+            'subtopics': subtopics,
+            'degrees_of_mastery': degrees_of_mastery,
+            'skill_descriptions': skill_descriptions
         })
         self.render_json(self.values)

{"golden_diff": "diff --git a/core/controllers/topic_viewer.py b/core/controllers/topic_viewer.py\n--- a/core/controllers/topic_viewer.py\n+++ b/core/controllers/topic_viewer.py\n@@ -17,6 +17,7 @@\n from constants import constants\n from core.controllers import acl_decorators\n from core.controllers import base\n+from core.domain import skill_services\n from core.domain import story_fetchers\n from core.domain import topic_fetchers\n import feconf\n@@ -74,12 +75,26 @@\n         uncategorized_skill_ids = topic.get_all_uncategorized_skill_ids()\n         subtopics = topic.get_all_subtopics()\n \n+        assigned_skill_ids = topic.get_all_skill_ids()\n+        skill_descriptions = skill_services.get_skill_descriptions_by_ids(\n+            topic.id, assigned_skill_ids)\n+\n+        if self.user_id:\n+            degrees_of_mastery = skill_services.get_multi_user_skill_mastery(\n+                self.user_id, assigned_skill_ids)\n+        else:\n+            degrees_of_mastery = {}\n+            for skill_id in assigned_skill_ids:\n+                degrees_of_mastery[skill_id] = None\n+\n         self.values.update({\n             'topic_id': topic.id,\n             'topic_name': topic.name,\n             'canonical_story_dicts': canonical_story_dicts,\n             'additional_story_dicts': additional_story_dicts,\n             'uncategorized_skill_ids': uncategorized_skill_ids,\n-            'subtopics': subtopics\n+            'subtopics': subtopics,\n+            'degrees_of_mastery': degrees_of_mastery,\n+            'skill_descriptions': skill_descriptions\n         })\n         self.render_json(self.values)\n", "issue": "Show skill mastery values in the topic viewer\nAdd a skill tab in the topic viewer that will show skill mastery of all skills in that topic (Once we have enough skill mastery information for the skill)\r\n\r\nMilestone 3.2 in @sophiewu6 's GSoC project\n", "before_files": [{"content": "# Copyright 2018 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Controllers for the topic viewer page.\"\"\"\n\nfrom constants import constants\nfrom core.controllers import acl_decorators\nfrom core.controllers import base\nfrom core.domain import story_fetchers\nfrom core.domain import topic_fetchers\nimport feconf\n\n\nclass TopicViewerPage(base.BaseHandler):\n    \"\"\"Renders the topic viewer page.\"\"\"\n\n    @acl_decorators.can_access_topic_viewer_page\n    def get(self, _):\n        \"\"\"Handles GET requests.\"\"\"\n\n        if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:\n            raise self.PageNotFoundException\n\n        self.render_template('dist/topic-viewer-page.mainpage.html')\n\n\nclass TopicPageDataHandler(base.BaseHandler):\n    \"\"\"Manages the data that needs to be displayed to a learner on the topic\n    viewer page.\n    \"\"\"\n    GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON\n\n    @acl_decorators.can_access_topic_viewer_page\n    def get(self, topic_name):\n        \"\"\"Handles GET requests.\"\"\"\n\n        if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:\n            raise self.PageNotFoundException\n\n        topic = topic_fetchers.get_topic_by_name(topic_name)\n        canonical_story_ids = topic.get_canonical_story_ids(\n            include_only_published=True)\n        additional_story_ids = topic.get_additional_story_ids(\n            include_only_published=True)\n        canonical_story_summaries = [\n            story_fetchers.get_story_summary_by_id(\n                canonical_story_id) for canonical_story_id\n            in canonical_story_ids]\n\n        additional_story_summaries = [\n            story_fetchers.get_story_summary_by_id(\n                additional_story_id) for additional_story_id\n            in additional_story_ids]\n\n        canonical_story_dicts = [\n            summary.to_human_readable_dict() for summary\n            in canonical_story_summaries]\n\n        additional_story_dicts = [\n            summary.to_human_readable_dict() for summary\n            in additional_story_summaries]\n\n        uncategorized_skill_ids = topic.get_all_uncategorized_skill_ids()\n        subtopics = topic.get_all_subtopics()\n\n        self.values.update({\n            'topic_id': topic.id,\n            'topic_name': topic.name,\n            'canonical_story_dicts': canonical_story_dicts,\n            'additional_story_dicts': additional_story_dicts,\n            'uncategorized_skill_ids': uncategorized_skill_ids,\n            'subtopics': subtopics\n        })\n        self.render_json(self.values)\n", "path": "core/controllers/topic_viewer.py"}], "after_files": [{"content": "# Copyright 2018 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Controllers for the topic viewer page.\"\"\"\n\nfrom constants import constants\nfrom core.controllers import acl_decorators\nfrom core.controllers import base\nfrom core.domain import skill_services\nfrom core.domain import story_fetchers\nfrom core.domain import topic_fetchers\nimport feconf\n\n\nclass TopicViewerPage(base.BaseHandler):\n    \"\"\"Renders the topic viewer page.\"\"\"\n\n    @acl_decorators.can_access_topic_viewer_page\n    def get(self, _):\n        \"\"\"Handles GET requests.\"\"\"\n\n        if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:\n            raise self.PageNotFoundException\n\n        self.render_template('dist/topic-viewer-page.mainpage.html')\n\n\nclass TopicPageDataHandler(base.BaseHandler):\n    \"\"\"Manages the data that needs to be displayed to a learner on the topic\n    viewer page.\n    \"\"\"\n    GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON\n\n    @acl_decorators.can_access_topic_viewer_page\n    def get(self, topic_name):\n        \"\"\"Handles GET requests.\"\"\"\n\n        if not constants.ENABLE_NEW_STRUCTURE_PLAYERS:\n            raise self.PageNotFoundException\n\n        topic = topic_fetchers.get_topic_by_name(topic_name)\n        canonical_story_ids = topic.get_canonical_story_ids(\n            include_only_published=True)\n        additional_story_ids = topic.get_additional_story_ids(\n            include_only_published=True)\n        canonical_story_summaries = [\n            story_fetchers.get_story_summary_by_id(\n                canonical_story_id) for canonical_story_id\n            in canonical_story_ids]\n\n        additional_story_summaries = [\n            story_fetchers.get_story_summary_by_id(\n                additional_story_id) for additional_story_id\n            in additional_story_ids]\n\n        canonical_story_dicts = [\n            summary.to_human_readable_dict() for summary\n            in canonical_story_summaries]\n\n        additional_story_dicts = [\n            summary.to_human_readable_dict() for summary\n            in additional_story_summaries]\n\n        uncategorized_skill_ids = topic.get_all_uncategorized_skill_ids()\n        subtopics = topic.get_all_subtopics()\n\n        assigned_skill_ids = topic.get_all_skill_ids()\n        skill_descriptions = skill_services.get_skill_descriptions_by_ids(\n            topic.id, assigned_skill_ids)\n\n        if self.user_id:\n            degrees_of_mastery = skill_services.get_multi_user_skill_mastery(\n                self.user_id, assigned_skill_ids)\n        else:\n            degrees_of_mastery = {}\n            for skill_id in assigned_skill_ids:\n                degrees_of_mastery[skill_id] = None\n\n        self.values.update({\n            'topic_id': topic.id,\n            'topic_name': topic.name,\n            'canonical_story_dicts': canonical_story_dicts,\n            'additional_story_dicts': additional_story_dicts,\n            'uncategorized_skill_ids': uncategorized_skill_ids,\n            'subtopics': subtopics,\n            'degrees_of_mastery': degrees_of_mastery,\n            'skill_descriptions': skill_descriptions\n        })\n        self.render_json(self.values)\n", "path": "core/controllers/topic_viewer.py"}]}