{"action":"created","comment":{"url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/comments/23719674","id":23719674,"diff_hunk":"@@ -83,54 +65,105 @@ class MentoringBlock(XBlockWithLightChildren, StepParentMixin):\n \n     @staticmethod\n     def is_default_xml_content(value):\n-        return _is_default_xml_content(value)\n-\n-    attempted = Boolean(help=\"Has the student attempted this mentoring step?\",\n-                        default=False, scope=Scope.user_state)\n-    completed = Boolean(help=\"Has the student completed this mentoring step?\",\n-                        default=False, scope=Scope.user_state)\n-    next_step = String(help=\"url_name of the next step the student must complete (global to all blocks)\",\n-                       default='mentoring_first', scope=Scope.preferences)\n-    followed_by = String(help=\"url_name of the step after the current mentoring block in workflow\",\n-                         default=None, scope=Scope.content)\n-    url_name = String(help=\"Name of the current step, used for URL building\",\n-                      default='mentoring-default', scope=Scope.content)\n-    enforce_dependency = Boolean(help=\"Should the next step be the current block to complete?\",\n-                                 default=False, scope=Scope.content, enforce_type=True)\n+        return value == default_xml_content\n+\n+    # Content\n+    MENTORING_MODES = ('standard', 'assessment')\n+    mode = String(\n+        help=\"Mode of the mentoring. 'standard' or 'assessment'\",\n+        default='standard',\n+        scope=Scope.content,\n+        values=MENTORING_MODES\n+    )\n+    followed_by = String(\n+        help=\"url_name of the step after the current mentoring block in workflow.\",\n+        default=None,\n+        scope=Scope.content\n+    )\n+    max_attempts = Integer(\n+        help=\"Number of max attempts for this questions\",\n+        default=0,\n+        scope=Scope.content,\n+        enforce_type=True\n+    )\n+    url_name = String(\n+        help=\"Name of the current step, used for URL building\",\n+        default='mentoring-default',  # TODO in future: set this to xblock.fields.UNIQUE_ID and remove self.url_name_with_default\n+        scope=Scope.content\n+    )\n+    enforce_dependency = Boolean(\n+        help=\"Should the next step be the current block to complete?\",\n+        default=False,\n+        scope=Scope.content,\n+        enforce_type=True\n+    )\n     display_submit = Boolean(help=\"Allow to submit current block?\", default=True, scope=Scope.content)\n-    xml_content = String(help=\"XML content\", default=_default_xml_content, scope=Scope.content)\n-    weight = Float(help=\"Defines the maximum total grade of the block.\",\n-                   default=1, scope=Scope.content, enforce_type=True)\n-    num_attempts = Integer(help=\"Number of attempts a user has answered for this questions\",\n-                           default=0, scope=Scope.user_state, enforce_type=True)\n-    max_attempts = Integer(help=\"Number of max attempts for this questions\", default=0,\n-                           scope=Scope.content, enforce_type=True)\n-    mode = String(help=\"Mode of the mentoring. 'standard' or 'assessment'\",\n-                  default='standard', scope=Scope.content)\n-    step = Integer(help=\"Keep track of the student assessment progress.\",\n-                   default=0, scope=Scope.user_state, enforce_type=True)\n-    student_results = List(help=\"Store results of student choices.\", default=[],\n-                           scope=Scope.user_state)\n-\n-    display_name = String(help=\"Display name of the component\", default=\"Mentoring XBlock\",\n-                          scope=Scope.settings)\n+    xml_content = String(help=\"XML content\", default=default_xml_content, scope=Scope.content)","path":"mentoring/mentoring.py","position":129,"original_position":128,"commit_id":"b6f6a97162e895a72b10d8befc6f14f812afaa33","original_commit_id":"e8a4bf0feca00da0b184280fd0749d88ffa4f593","user":{"login":"Kelketek","id":1099483,"avatar_url":"https://avatars.githubusercontent.com/u/1099483?v=3","gravatar_id":"","url":"https://api.github.com/users/Kelketek","html_url":"https://github.com/Kelketek","followers_url":"https://api.github.com/users/Kelketek/followers","following_url":"https://api.github.com/users/Kelketek/following{/other_user}","gists_url":"https://api.github.com/users/Kelketek/gists{/gist_id}","starred_url":"https://api.github.com/users/Kelketek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kelketek/subscriptions","organizations_url":"https://api.github.com/users/Kelketek/orgs","repos_url":"https://api.github.com/users/Kelketek/repos","events_url":"https://api.github.com/users/Kelketek/events{/privacy}","received_events_url":"https://api.github.com/users/Kelketek/received_events","type":"User","site_admin":false},"body":"@bradenmacdonald @antoviaque I've been seeing this thorn in our side keep coming up. Do we even need to bother with `url_name`? That's automatically generated at random by the CMS. Why do we handle it manually here? If it's omitted from the XML, it will still be set under the hood. Is there something special we're doing with it?","created_at":"2015-01-28T20:19:22Z","updated_at":"2015-01-28T20:19:22Z","html_url":"https://github.com/open-craft/xblock-mentoring/pull/1#discussion_r23719674","pull_request_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/comments/23719674"},"html":{"href":"https://github.com/open-craft/xblock-mentoring/pull/1#discussion_r23719674"},"pull_request":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1","id":27910165,"html_url":"https://github.com/open-craft/xblock-mentoring/pull/1","diff_url":"https://github.com/open-craft/xblock-mentoring/pull/1.diff","patch_url":"https://github.com/open-craft/xblock-mentoring/pull/1.patch","issue_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/1","number":1,"state":"open","locked":false,"title":"Real children","user":{"login":"bradenmacdonald","id":945577,"avatar_url":"https://avatars.githubusercontent.com/u/945577?v=3","gravatar_id":"","url":"https://api.github.com/users/bradenmacdonald","html_url":"https://github.com/bradenmacdonald","followers_url":"https://api.github.com/users/bradenmacdonald/followers","following_url":"https://api.github.com/users/bradenmacdonald/following{/other_user}","gists_url":"https://api.github.com/users/bradenmacdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/bradenmacdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradenmacdonald/subscriptions","organizations_url":"https://api.github.com/users/bradenmacdonald/orgs","repos_url":"https://api.github.com/users/bradenmacdonald/repos","events_url":"https://api.github.com/users/bradenmacdonald/events{/privacy}","received_events_url":"https://api.github.com/users/bradenmacdonald/received_events","type":"User","site_admin":false},"body":"This removes LightChildren functionality from mentoring and converts all the LightChildren into full-fledged XBlocks.\r\n\r\nI also moved all the former LightChildren into the \"components\" folder to make it easier to move them to separate repositories in the future.\r\n\r\nI was also able to remove the dependence on Django models, though it still uses Django for template rendering and testing.\r\n\r\n**Notes and questions**:\r\n\r\n* XBlock names are very likely to conflict with other people's XBlocks... (e.g. `html` !). But the name of the block is determined by the tag name. May want to add a migration path to convert the XML to use namespaced blocks like `<mentoring-html>` instead of `<html>`. Or just make our HTML block the standard one and move it to a separate repository.\r\n* Should not be installed on any system that actively uses other XBlocks depending on light_children (causes \"ImportError: from mentoring import light_children\")\r\n* I got all the tests to pass but I think this needs more testing to be sure it won't break anything when installed onto edX instances already using the prior version\r\n* What do I put as the copyright in new files, if anything? The current files all say \"Copyright (C) 2014 Harvard\"","created_at":"2015-01-23T09:18:21Z","updated_at":"2015-01-28T20:19:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5531ca7b2d54d14f52232b32cd6730d3e47a8e40","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1/commits","review_comments_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1/comments","review_comment_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/comments/{number}","comments_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/1/comments","statuses_url":"https://api.github.com/repos/open-craft/xblock-mentoring/statuses/b6f6a97162e895a72b10d8befc6f14f812afaa33","head":{"label":"open-craft:real-children","ref":"real-children","sha":"b6f6a97162e895a72b10d8befc6f14f812afaa33","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":29684458,"name":"xblock-mentoring","full_name":"open-craft/xblock-mentoring","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/xblock-mentoring","description":"Mentoring XBlock for edX","fork":true,"url":"https://api.github.com/repos/open-craft/xblock-mentoring","forks_url":"https://api.github.com/repos/open-craft/xblock-mentoring/forks","keys_url":"https://api.github.com/repos/open-craft/xblock-mentoring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/xblock-mentoring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/xblock-mentoring/teams","hooks_url":"https://api.github.com/repos/open-craft/xblock-mentoring/hooks","issue_events_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/xblock-mentoring/events","assignees_url":"https://api.github.com/repos/open-craft/xblock-mentoring/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/xblock-mentoring/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/xblock-mentoring/tags","blobs_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/xblock-mentoring/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/xblock-mentoring/languages","stargazers_url":"https://api.github.com/repos/open-craft/xblock-mentoring/stargazers","contributors_url":"https://api.github.com/repos/open-craft/xblock-mentoring/contributors","subscribers_url":"https://api.github.com/repos/open-craft/xblock-mentoring/subscribers","subscription_url":"https://api.github.com/repos/open-craft/xblock-mentoring/subscription","commits_url":"https://api.github.com/repos/open-craft/xblock-mentoring/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/xblock-mentoring/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/comments/{number}","contents_url":"https://api.github.com/repos/open-craft/xblock-mentoring/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/xblock-mentoring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/xblock-mentoring/merges","archive_url":"https://api.github.com/repos/open-craft/xblock-mentoring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/xblock-mentoring/downloads","issues_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/xblock-mentoring/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/xblock-mentoring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/xblock-mentoring/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/xblock-mentoring/releases{/id}","created_at":"2015-01-22T15:11:16Z","updated_at":"2015-01-22T15:11:17Z","pushed_at":"2015-01-28T09:44:18Z","git_url":"git://github.com/open-craft/xblock-mentoring.git","ssh_url":"git@github.com:open-craft/xblock-mentoring.git","clone_url":"https://github.com/open-craft/xblock-mentoring.git","svn_url":"https://github.com/open-craft/xblock-mentoring","homepage":null,"size":1523,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"open-craft:master","ref":"master","sha":"879241be227c4db48651af1c36e0cf7a1bb320be","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":29684458,"name":"xblock-mentoring","full_name":"open-craft/xblock-mentoring","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/xblock-mentoring","description":"Mentoring XBlock for edX","fork":true,"url":"https://api.github.com/repos/open-craft/xblock-mentoring","forks_url":"https://api.github.com/repos/open-craft/xblock-mentoring/forks","keys_url":"https://api.github.com/repos/open-craft/xblock-mentoring/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/xblock-mentoring/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/xblock-mentoring/teams","hooks_url":"https://api.github.com/repos/open-craft/xblock-mentoring/hooks","issue_events_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/xblock-mentoring/events","assignees_url":"https://api.github.com/repos/open-craft/xblock-mentoring/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/xblock-mentoring/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/xblock-mentoring/tags","blobs_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/xblock-mentoring/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/xblock-mentoring/languages","stargazers_url":"https://api.github.com/repos/open-craft/xblock-mentoring/stargazers","contributors_url":"https://api.github.com/repos/open-craft/xblock-mentoring/contributors","subscribers_url":"https://api.github.com/repos/open-craft/xblock-mentoring/subscribers","subscription_url":"https://api.github.com/repos/open-craft/xblock-mentoring/subscription","commits_url":"https://api.github.com/repos/open-craft/xblock-mentoring/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/xblock-mentoring/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/xblock-mentoring/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/comments/{number}","contents_url":"https://api.github.com/repos/open-craft/xblock-mentoring/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/xblock-mentoring/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/xblock-mentoring/merges","archive_url":"https://api.github.com/repos/open-craft/xblock-mentoring/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/xblock-mentoring/downloads","issues_url":"https://api.github.com/repos/open-craft/xblock-mentoring/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/xblock-mentoring/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/xblock-mentoring/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/xblock-mentoring/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/xblock-mentoring/releases{/id}","created_at":"2015-01-22T15:11:16Z","updated_at":"2015-01-22T15:11:17Z","pushed_at":"2015-01-28T09:44:18Z","git_url":"git://github.com/open-craft/xblock-mentoring.git","ssh_url":"git@github.com:open-craft/xblock-mentoring.git","clone_url":"https://github.com/open-craft/xblock-mentoring.git","svn_url":"https://github.com/open-craft/xblock-mentoring","homepage":null,"size":1523,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1"},"html":{"href":"https://github.com/open-craft/xblock-mentoring/pull/1"},"issue":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/1"},"comments":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/xblock-mentoring/statuses/b6f6a97162e895a72b10d8befc6f14f812afaa33"}}}}