{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/70962788","id":70962788,"diff_hunk":"@@ -1,6 +1,23 @@\n+from app.questionnaire_state.answer import Answer\n+from app.questionnaire_state.item import Item\n \n \n-class Question(object):\n+class Question(Item):\n     def __init__(self, id):\n-        self.id = id\n+        super().__init__(id=id)\n         self.answers = []\n+        self.children = self.answers\n+\n+    def get_answers(self):\n+        answers = []\n+        for child in self.children:\n+            answers.append(child.get_answer())","path":"app/questionnaire_state/question.py","position":16,"original_position":16,"commit_id":"a6f5c5118d6d6ee567a1a65f8a5a422a53efaa1a","original_commit_id":"a6f5c5118d6d6ee567a1a65f8a5a422a53efaa1a","user":{"login":"dhilton","id":47292,"avatar_url":"https://avatars.githubusercontent.com/u/47292?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilton","html_url":"https://github.com/dhilton","followers_url":"https://api.github.com/users/dhilton/followers","following_url":"https://api.github.com/users/dhilton/following{/other_user}","gists_url":"https://api.github.com/users/dhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilton/subscriptions","organizations_url":"https://api.github.com/users/dhilton/orgs","repos_url":"https://api.github.com/users/dhilton/repos","events_url":"https://api.github.com/users/dhilton/events{/privacy}","received_events_url":"https://api.github.com/users/dhilton/received_events","type":"User","site_admin":false},"body":"Do you mean append or do you mean to use extend? get_answers seems to return a list even if a single value is found, so I think you end up with a list of lists rather than just a single list of answers. Also I can't see the difference between this method and the parent method on the Item class shown in https://github.com/ONSdigital/eq-survey-runner/pull/313/files#diff-5f2cdd4ed301f540243d3474c5f36f01R24","created_at":"2016-07-15T12:18:04Z","updated_at":"2016-07-15T12:18:04Z","html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/313#discussion_r70962788","pull_request_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/70962788"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/313#discussion_r70962788"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313","id":77575239,"html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/313","diff_url":"https://github.com/ONSdigital/eq-survey-runner/pull/313.diff","patch_url":"https://github.com/ONSdigital/eq-survey-runner/pull/313.patch","issue_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/313","number":313,"state":"open","locked":false,"title":"EQ 410 User Journey Manager","user":{"login":"warrenbailey","id":14093825,"avatar_url":"https://avatars.githubusercontent.com/u/14093825?v=3","gravatar_id":"","url":"https://api.github.com/users/warrenbailey","html_url":"https://github.com/warrenbailey","followers_url":"https://api.github.com/users/warrenbailey/followers","following_url":"https://api.github.com/users/warrenbailey/following{/other_user}","gists_url":"https://api.github.com/users/warrenbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/warrenbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warrenbailey/subscriptions","organizations_url":"https://api.github.com/users/warrenbailey/orgs","repos_url":"https://api.github.com/users/warrenbailey/repos","events_url":"https://api.github.com/users/warrenbailey/events{/privacy}","received_events_url":"https://api.github.com/users/warrenbailey/received_events","type":"User","site_admin":false},"body":"### What is the context of this PR?\r\nThe introduction of the User Journey Manager. This is essentially a data structure for keeping track of a users interaction with a survey. It uses a doubly linked list to maintain the position in the survey and state objects to store information about each page, such as the responses the user has answered to the question, validation state and the typed value of each response.\r\n\r\nThis change has also refactored the current answer store to use the new data structure. This is a temporary solution until a wider refactor happens making the answer store obsolete.\r\n\r\nThe next step is to refactor the navigation and validation components to use this list. However in order to make this pull request manageable it is desirable to review and merge the refactoring at this point. As such there are various TODO scattered around the code base.\r\n\r\n### How to review \r\n1. Confirm all the tests and integration tests pass\r\n2. Check you can still complete a survey successfully.\r\n\r\n- [ ] Do all commits have sensible commit messages?\r\n- [ ] Is all new code unit tested?\r\n- [ ] Are there integration tests if needed?\r\n- [ ] Is there sufficient logging?\r\n- [ ] Is there documentation or is the code self-describing?\r\n\r\n### Who worked on the PR\r\n@warrenbailey and @weapdiv-david both worked on this PR. So this change needs to be reviewed by @dhilton and @LJBabbage \r\n","created_at":"2016-07-15T07:37:43Z","updated_at":"2016-07-15T12:18:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"071c5fa143b7ec77cd3c046a73e80030dda3b666","assignee":{"login":"dhilton","id":47292,"avatar_url":"https://avatars.githubusercontent.com/u/47292?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilton","html_url":"https://github.com/dhilton","followers_url":"https://api.github.com/users/dhilton/followers","following_url":"https://api.github.com/users/dhilton/following{/other_user}","gists_url":"https://api.github.com/users/dhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilton/subscriptions","organizations_url":"https://api.github.com/users/dhilton/orgs","repos_url":"https://api.github.com/users/dhilton/repos","events_url":"https://api.github.com/users/dhilton/events{/privacy}","received_events_url":"https://api.github.com/users/dhilton/received_events","type":"User","site_admin":false},"assignees":[{"login":"dhilton","id":47292,"avatar_url":"https://avatars.githubusercontent.com/u/47292?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilton","html_url":"https://github.com/dhilton","followers_url":"https://api.github.com/users/dhilton/followers","following_url":"https://api.github.com/users/dhilton/following{/other_user}","gists_url":"https://api.github.com/users/dhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilton/subscriptions","organizations_url":"https://api.github.com/users/dhilton/orgs","repos_url":"https://api.github.com/users/dhilton/repos","events_url":"https://api.github.com/users/dhilton/events{/privacy}","received_events_url":"https://api.github.com/users/dhilton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/313/comments","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/a6f5c5118d6d6ee567a1a65f8a5a422a53efaa1a","head":{"label":"ONSdigital:eq-410-questionnaire-state","ref":"eq-410-questionnaire-state","sha":"a6f5c5118d6d6ee567a1a65f8a5a422a53efaa1a","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2016-04-07T08:22:43Z","pushed_at":"2016-07-15T12:06:52Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":6693,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"ONSdigital:master","ref":"master","sha":"374d20d60c17521f05f74c1e88ed1ea689770db7","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2016-04-07T08:22:43Z","pushed_at":"2016-07-15T12:06:52Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":6693,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/313"},"issue":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/313"},"comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/a6f5c5118d6d6ee567a1a65f8a5a422a53efaa1a"}}}}
{"actor":{"display_login":"dhilton"}}