{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/193532881","pull_request_review_id":126520602,"id":193532881,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzUzMjg4MQ==","diff_hunk":"@@ -347,22 +487,135 @@ def update_additional_story_ids(self, new_additional_story_ids):\n         \"\"\"\n         self.additional_story_ids = new_additional_story_ids\n \n-    def update_skill_ids(self, new_skill_ids):\n+    def add_uncategorized_skill_id(self, new_uncategorized_skill_id):\n         \"\"\"Updates the skill id list of a topic object.\n \n         Args:\n-            new_skill_ids: list(str). The updated list of skill ids.\n+            new_uncategorized_skill_id: str. The new skill id to add to\n+                uncategorized_skill_ids list.\n+\n+        Raises:\n+            Exception. The given skill id is already present in a subtopic.\n+        \"\"\"\n+        for subtopic in self.subtopics:\n+            if new_uncategorized_skill_id in subtopic.skill_ids:\n+                raise Exception(\n+                    'The skill id %s already exists in subtopic with id %s.'\n+                    % (new_uncategorized_skill_id, subtopic.id))\n+        self.uncategorized_skill_ids.append(new_uncategorized_skill_id)\n+\n+    def remove_uncategorized_skill_id(self, uncategorized_skill_id):\n+        \"\"\"Updates the skill id list of a topic object.\n+\n+        Args:\n+            uncategorized_skill_id: str. The skill id to be removed from the\n+                uncategorized_skill_ids list.\n+\n+        Raises:\n+            Exception. The given skill id is not present in the\n+                uncategorized_skill_ids list.\n+        \"\"\"\n+        if uncategorized_skill_id not in self.uncategorized_skill_ids:\n+            raise Exception(\n+                'The skill id %s is not present in the topic.'\n+                % uncategorized_skill_id)\n+        self.uncategorized_skill_ids.remove(uncategorized_skill_id)\n+\n+    def get_subtopic_index(self, subtopic_id):\n+        \"\"\"Gets the index of the subtopic with the given id in the subtopics\n+        list.\n+\n+        Args:\n+            subtopic_id: str. The id of the subtopic for which the index is to\n+                be found.\n+\n+        Returns:\n+            int or None. Returns the index of the subtopic if it exists or else\n+                None.\n+        \"\"\"\n+        for ind, subtopic in enumerate(self.subtopics):\n+            if subtopic.id == subtopic_id:\n+                return ind\n+        return None\n+\n+    def add_subtopic(self, subtopic_id, title):\n+        \"\"\"Adds a subtopic with the given id and title.\n+\n+        Args:\n+            subtopic_id: str. The id for the new subtopic.\n+            title: str. The title for the new subtopic.\n+\n+        Raises:\n+            Exception. A subtopic with the given id already exists.\n         \"\"\"\n-        self.skill_ids = new_skill_ids\n+        if self.get_subtopic_index(subtopic_id) is not None:\n+            raise Exception(\n+                'A subtopic with id %s already exists. ' % subtopic_id)\n+        self.subtopics.append(\n+            Subtopic.create_default_subtopic(subtopic_id, title))\n+\n+    def delete_subtopic(self, subtopic_id):\n+        \"\"\"Deletes the subtopic with the given id and adds all its skills to\n+        uncategorized skill ids section.\n+\n+        Args:\n+            subtopic_id: str. The id of the subtopic to remove.\n+\n+        Raises:\n+            Exception. A subtopic with the given id doesn't exists.\n+        \"\"\"\n+        subtopic_index = self.get_subtopic_index(subtopic_id)\n+        if subtopic_index is None:\n+            raise Exception(\n+                'A subtopic with id %s doesn\\'t exists. ' % subtopic_id)\n+        for skill_id in self.subtopics[subtopic_index].skill_ids:\n+            self.uncategorized_skill_ids.append(skill_id)\n+        del self.subtopics[subtopic_index]\n+\n+    def update_subtopic_title(self, subtopic_id, new_title):\n+        \"\"\"Updates the title of the new subtopic.\n+\n+        Args:\n+            subtopic_id: str. The id of the subtopic to edit.\n+            new_title: str. The new title for the subtopic.\n+\n+        Raises:\n+            Exception. The subtopic with the given id doesn't exist.\n+        \"\"\"\n+        subtopic_index = self.get_subtopic_index(subtopic_id)\n+        if subtopic_index is None:\n+            raise Exception(\n+                'The subtopic with id %s does not exist.' % subtopic_id)\n+        self.subtopics[subtopic_index].title = new_title\n+\n+    def update_subtopic_skill_ids(self, subtopic_id, new_skill_ids):","path":"core/domain/topic_domain.py","position":424,"original_position":424,"commit_id":"b946d721ce41419e3e685205e5957b57ec74572c","original_commit_id":"b946d721ce41419e3e685205e5957b57ec74572c","user":{"login":"seanlip","id":10575562,"node_id":"MDQ6VXNlcjEwNTc1NTYy","avatar_url":"https://avatars0.githubusercontent.com/u/10575562?v=4","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"body":"Instead of this, don't you need something that's more like \"move skill to subtopic\" (or remove skill from subtopic)? Just thinking about how this will be used in practice and what the atomic operations (to the user) are.","created_at":"2018-06-06T19:33:17Z","updated_at":"2018-06-06T19:38:28Z","html_url":"https://github.com/oppia/oppia/pull/5049#discussion_r193532881","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/5049","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/193532881"},"html":{"href":"https://github.com/oppia/oppia/pull/5049#discussion_r193532881"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5049"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/5049","id":193113396,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzMTEzMzk2","html_url":"https://github.com/oppia/oppia/pull/5049","diff_url":"https://github.com/oppia/oppia/pull/5049.diff","patch_url":"https://github.com/oppia/oppia/pull/5049.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/5049","number":5049,"state":"open","locked":false,"title":"Modified topic and story models","user":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"body":"In this PR, a new Subtopic object and its related functions have been added to topic_domain and topic_services.\r\nAlso, a new outlines_are_finalized field has been added to class StoryNode.","created_at":"2018-06-06T19:16:40Z","updated_at":"2018-06-06T19:38:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"158483ca6e1e4e5783ce25c046db9234c2cbd7c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/5049/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/5049/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/5049/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/b946d721ce41419e3e685205e5957b57ec74572c","head":{"label":"aks681:additional-changes","ref":"additional-changes","sha":"b946d721ce41419e3e685205e5957b57ec74572c","user":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"repo":{"id":112202645,"node_id":"MDEwOlJlcG9zaXRvcnkxMTIyMDI2NDU=","name":"oppia","full_name":"aks681/oppia","owner":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aks681/oppia","description":"Tool for collaboratively building interactive lessons.","fork":true,"url":"https://api.github.com/repos/aks681/oppia","forks_url":"https://api.github.com/repos/aks681/oppia/forks","keys_url":"https://api.github.com/repos/aks681/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aks681/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aks681/oppia/teams","hooks_url":"https://api.github.com/repos/aks681/oppia/hooks","issue_events_url":"https://api.github.com/repos/aks681/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/aks681/oppia/events","assignees_url":"https://api.github.com/repos/aks681/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/aks681/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/aks681/oppia/tags","blobs_url":"https://api.github.com/repos/aks681/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aks681/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aks681/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/aks681/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aks681/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/aks681/oppia/languages","stargazers_url":"https://api.github.com/repos/aks681/oppia/stargazers","contributors_url":"https://api.github.com/repos/aks681/oppia/contributors","subscribers_url":"https://api.github.com/repos/aks681/oppia/subscribers","subscription_url":"https://api.github.com/repos/aks681/oppia/subscription","commits_url":"https://api.github.com/repos/aks681/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/aks681/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/aks681/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/aks681/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/aks681/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/aks681/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aks681/oppia/merges","archive_url":"https://api.github.com/repos/aks681/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aks681/oppia/downloads","issues_url":"https://api.github.com/repos/aks681/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/aks681/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/aks681/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/aks681/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aks681/oppia/labels{/name}","releases_url":"https://api.github.com/repos/aks681/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/aks681/oppia/deployments","created_at":"2017-11-27T13:56:34Z","updated_at":"2018-06-06T19:29:19Z","pushed_at":"2018-06-06T19:29:17Z","git_url":"git://github.com/aks681/oppia.git","ssh_url":"git@github.com:aks681/oppia.git","clone_url":"https://github.com/aks681/oppia.git","svn_url":"https://github.com/aks681/oppia","homepage":"https://www.oppia.org","size":103388,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"5ecbfcfb8c017a1afa004e55e28b66418e450e9c","user":{"login":"oppia","id":11620230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjIwMjMw","avatar_url":"https://avatars1.githubusercontent.com/u/11620230?v=4","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"node_id":"MDEwOlJlcG9zaXRvcnk0MDY4NzU2Mw==","name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjIwMjMw","avatar_url":"https://avatars1.githubusercontent.com/u/11620230?v=4","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive lessons.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2018-06-06T18:53:04Z","pushed_at":"2018-06-06T19:23:50Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":103637,"stargazers_count":668,"watchers_count":668,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":642,"mirror_url":null,"archived":false,"open_issues_count":310,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":642,"open_issues":310,"watchers":668,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5049"},"html":{"href":"https://github.com/oppia/oppia/pull/5049"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/5049"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/5049/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5049/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5049/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/b946d721ce41419e3e685205e5957b57ec74572c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"seanlip"}}