{"action":"created","comment":{"url":"https://api.github.com/repos/thecartercenter/elmo/pulls/comments/168304105","pull_request_review_id":96650116,"id":168304105,"diff_hunk":"@@ -6,14 +6,86 @@\n   let(:xml) { build_odk_submission(form, data: data) }\n   let(:files) { {xml_submission_file: StringIO.new(xml)} }\n   let(:response) { Response.new(form: form, mission: form.mission, user: create(:user)) }\n-  let(:submission) { XMLSubmission.new(response: response, source: \"odk\", files: files) }\n+  let(:submission) { XMLSubmission.new(response: response, files: files) }\n   let(:nodes) { AnswerArranger.new(response).build.nodes }\n \n   before do\n     form.publish!\n     submission.save\n   end\n \n+  context \"nested repeat groups\" do\n+    let(:form) do\n+      create(:form, :published, :with_version,\n+        name: \"Nested Repeat Group\",\n+        version: \"abc\",\n+        question_types: [\n+          {repeating:\n+            {\n+              items:\n+                [\"text\", #q1\n+                  \"text\", #q2\n+                  {\n+                    repeating:\n+                      {\n+                        items: [\"integer\", \"integer\"], #q3,q4\n+                        name: \"Repeat Group A\"\n+                      }\n+                  },\n+                  \"long_text\" #q5\n+                ],\n+                name: \"Repeat Group 1\"\n+            }\n+          },\n+          \"text\", #q6\n+           {\n+            repeating: {\n+              items: [\"text\"], #q7\n+              name: \"Repeat Group 2\"\n+            }\n+          }\n+        ]\n+      )\n+    end\n+\n+    let(:files) {{xml_submission_file: StringIO.new(prepare_odk_expectation(\"nested.xml\", form))} }\n+    let(:response) { Response.new(form: form, mission: form.mission, user: create(:user)) }\n+    let(:submission) { XMLSubmission.new(response: response, files: files) }\n+    let(:nodes) { AnswerArranger.new(response).build.nodes }\n+\n+\n+    it \"processes nested repeats correctly\" do\n+      expect(nodes[0].instances[0].nodes[0].set.answers[0].value).to eq \"Bat\"\n+      expect(nodes[0].instances[0].nodes[1].set.answers[0].value).to eq \"Cat\"\n+      expect(nodes[0].instances[0].nodes[2].instances[0].nodes[0].set.answers[0].value).to eq \"1\"\n+      expect(nodes[0].instances[0].nodes[2].instances[0].nodes[1].set.answers[0].value).to eq \"2\"\n+      expect(nodes[0].instances[0].nodes[2].instances[1].nodes[0].set.answers[0].value).to eq \"3\"\n+      expect(nodes[0].instances[0].nodes[2].instances[1].nodes[1].set.answers[0].value).to eq \"4\"\n+      expect(nodes[0].instances[0].nodes[3].set.answers[0].value).to eq \"Whether\"\n+      expect(nodes[0].instances[1].nodes[0].set.answers[0].value).to eq \"Box\"\n+      expect(nodes[0].instances[1].nodes[1].set.answers[0].value).to eq \"Fox\"\n+      #BELOW works, but this is WRONG. Current data representation of answers has no knowledge of which parent repeat group 5 and 6 go in\n+      # the answers 5 and 6 should be in the first instance of repeat group A in the 2nd instance of repeat group 1.\n+      # currently they are in the 3rd instance of repeat group A in the 1st instance of repeat group 1, and\n+      # there is no second instance of repeat group 1 according to answer arranger.\n+      #expect(nodes[0].instances[0].nodes[2].instances[2].nodes[0].set.answers[0].value).to eq \"5\"\n+      #expect(nodes[0].instances[0].nodes[2].instances[2].nodes[1].set.answers[0].value).to eq \"6\"\n+      #below 2 lines does not work, and needs to work represent there are multiple instances of first repeat group\n+      expect(nodes[0].instances[1].nodes[2].instances[0].nodes[0].set.answers[0].value).to eq \"5\"\n+      expect(nodes[0].instances[1].nodes[2].instances[0].nodes[1].set.answers[0].value).to eq \"6\"\n+\n+      expect(nodes[0].instances[1].nodes[3].set.answers[0].value).to eq \"Weather\"\n+      expect(nodes[1].set.answers[0].value).to eq \"Tomato\"\n+      expect(nodes[2].instances[0].nodes[0].set.answers[0].value).to eq \"Hi\"\n+      expect(nodes[2].instances[1].nodes[0].set.answers[0].value).to eq \"Bye\"\n+\n+\n+","path":"spec/models/xml_submission_spec.rb","position":79,"original_position":79,"commit_id":"201fbfc0d8f154a053ccaf8958d2b9595c19496c","original_commit_id":"201fbfc0d8f154a053ccaf8958d2b9595c19496c","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Extra blank line detected.","created_at":"2018-02-14T20:44:07Z","updated_at":"2018-02-14T20:44:08Z","html_url":"https://github.com/thecartercenter/elmo/pull/411#discussion_r168304105","pull_request_url":"https://api.github.com/repos/thecartercenter/elmo/pulls/411","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/comments/168304105"},"html":{"href":"https://github.com/thecartercenter/elmo/pull/411#discussion_r168304105"},"pull_request":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/411"}}},"pull_request":{"url":"https://api.github.com/repos/thecartercenter/elmo/pulls/411","id":169217032,"html_url":"https://github.com/thecartercenter/elmo/pull/411","diff_url":"https://github.com/thecartercenter/elmo/pull/411.diff","patch_url":"https://github.com/thecartercenter/elmo/pull/411.patch","issue_url":"https://api.github.com/repos/thecartercenter/elmo/issues/411","number":411,"state":"open","locked":false,"title":"6441 ndeep odk response","user":{"login":"DevneyHamilton","id":4730344,"avatar_url":"https://avatars2.githubusercontent.com/u/4730344?v=4","gravatar_id":"","url":"https://api.github.com/users/DevneyHamilton","html_url":"https://github.com/DevneyHamilton","followers_url":"https://api.github.com/users/DevneyHamilton/followers","following_url":"https://api.github.com/users/DevneyHamilton/following{/other_user}","gists_url":"https://api.github.com/users/DevneyHamilton/gists{/gist_id}","starred_url":"https://api.github.com/users/DevneyHamilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DevneyHamilton/subscriptions","organizations_url":"https://api.github.com/users/DevneyHamilton/orgs","repos_url":"https://api.github.com/users/DevneyHamilton/repos","events_url":"https://api.github.com/users/DevneyHamilton/events{/privacy}","received_events_url":"https://api.github.com/users/DevneyHamilton/received_events","type":"User","site_admin":false},"body":"Reference nested group answer work. ","created_at":"2018-02-14T20:43:52Z","updated_at":"2018-02-14T20:44:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":837584563,"url":"https://api.github.com/repos/thecartercenter/elmo/labels/do-not-merge","name":"do-not-merge","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/thecartercenter/elmo/pulls/411/commits","review_comments_url":"https://api.github.com/repos/thecartercenter/elmo/pulls/411/comments","review_comment_url":"https://api.github.com/repos/thecartercenter/elmo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thecartercenter/elmo/issues/411/comments","statuses_url":"https://api.github.com/repos/thecartercenter/elmo/statuses/201fbfc0d8f154a053ccaf8958d2b9595c19496c","head":{"label":"thecartercenter:6441_ndeep_odk_response","ref":"6441_ndeep_odk_response","sha":"201fbfc0d8f154a053ccaf8958d2b9595c19496c","user":{"login":"thecartercenter","id":5075178,"avatar_url":"https://avatars1.githubusercontent.com/u/5075178?v=4","gravatar_id":"","url":"https://api.github.com/users/thecartercenter","html_url":"https://github.com/thecartercenter","followers_url":"https://api.github.com/users/thecartercenter/followers","following_url":"https://api.github.com/users/thecartercenter/following{/other_user}","gists_url":"https://api.github.com/users/thecartercenter/gists{/gist_id}","starred_url":"https://api.github.com/users/thecartercenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecartercenter/subscriptions","organizations_url":"https://api.github.com/users/thecartercenter/orgs","repos_url":"https://api.github.com/users/thecartercenter/repos","events_url":"https://api.github.com/users/thecartercenter/events{/privacy}","received_events_url":"https://api.github.com/users/thecartercenter/received_events","type":"Organization","site_admin":false},"repo":{"id":11615188,"name":"elmo","full_name":"thecartercenter/elmo","owner":{"login":"thecartercenter","id":5075178,"avatar_url":"https://avatars1.githubusercontent.com/u/5075178?v=4","gravatar_id":"","url":"https://api.github.com/users/thecartercenter","html_url":"https://github.com/thecartercenter","followers_url":"https://api.github.com/users/thecartercenter/followers","following_url":"https://api.github.com/users/thecartercenter/following{/other_user}","gists_url":"https://api.github.com/users/thecartercenter/gists{/gist_id}","starred_url":"https://api.github.com/users/thecartercenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecartercenter/subscriptions","organizations_url":"https://api.github.com/users/thecartercenter/orgs","repos_url":"https://api.github.com/users/thecartercenter/repos","events_url":"https://api.github.com/users/thecartercenter/events{/privacy}","received_events_url":"https://api.github.com/users/thecartercenter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thecartercenter/elmo","description":null,"fork":false,"url":"https://api.github.com/repos/thecartercenter/elmo","forks_url":"https://api.github.com/repos/thecartercenter/elmo/forks","keys_url":"https://api.github.com/repos/thecartercenter/elmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thecartercenter/elmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thecartercenter/elmo/teams","hooks_url":"https://api.github.com/repos/thecartercenter/elmo/hooks","issue_events_url":"https://api.github.com/repos/thecartercenter/elmo/issues/events{/number}","events_url":"https://api.github.com/repos/thecartercenter/elmo/events","assignees_url":"https://api.github.com/repos/thecartercenter/elmo/assignees{/user}","branches_url":"https://api.github.com/repos/thecartercenter/elmo/branches{/branch}","tags_url":"https://api.github.com/repos/thecartercenter/elmo/tags","blobs_url":"https://api.github.com/repos/thecartercenter/elmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thecartercenter/elmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thecartercenter/elmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/thecartercenter/elmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thecartercenter/elmo/statuses/{sha}","languages_url":"https://api.github.com/repos/thecartercenter/elmo/languages","stargazers_url":"https://api.github.com/repos/thecartercenter/elmo/stargazers","contributors_url":"https://api.github.com/repos/thecartercenter/elmo/contributors","subscribers_url":"https://api.github.com/repos/thecartercenter/elmo/subscribers","subscription_url":"https://api.github.com/repos/thecartercenter/elmo/subscription","commits_url":"https://api.github.com/repos/thecartercenter/elmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/thecartercenter/elmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/thecartercenter/elmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/thecartercenter/elmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/thecartercenter/elmo/contents/{+path}","compare_url":"https://api.github.com/repos/thecartercenter/elmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thecartercenter/elmo/merges","archive_url":"https://api.github.com/repos/thecartercenter/elmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thecartercenter/elmo/downloads","issues_url":"https://api.github.com/repos/thecartercenter/elmo/issues{/number}","pulls_url":"https://api.github.com/repos/thecartercenter/elmo/pulls{/number}","milestones_url":"https://api.github.com/repos/thecartercenter/elmo/milestones{/number}","notifications_url":"https://api.github.com/repos/thecartercenter/elmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thecartercenter/elmo/labels{/name}","releases_url":"https://api.github.com/repos/thecartercenter/elmo/releases{/id}","deployments_url":"https://api.github.com/repos/thecartercenter/elmo/deployments","created_at":"2013-07-23T17:56:04Z","updated_at":"2018-01-23T06:42:53Z","pushed_at":"2018-02-14T20:43:53Z","git_url":"git://github.com/thecartercenter/elmo.git","ssh_url":"git@github.com:thecartercenter/elmo.git","clone_url":"https://github.com/thecartercenter/elmo.git","svn_url":"https://github.com/thecartercenter/elmo","homepage":null,"size":70826,"stargazers_count":28,"watchers_count":28,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":37,"open_issues":6,"watchers":28,"default_branch":"develop"}},"base":{"label":"thecartercenter:develop","ref":"develop","sha":"23c1e731c6f1454bab1a5ad62b77b7bced3b531f","user":{"login":"thecartercenter","id":5075178,"avatar_url":"https://avatars1.githubusercontent.com/u/5075178?v=4","gravatar_id":"","url":"https://api.github.com/users/thecartercenter","html_url":"https://github.com/thecartercenter","followers_url":"https://api.github.com/users/thecartercenter/followers","following_url":"https://api.github.com/users/thecartercenter/following{/other_user}","gists_url":"https://api.github.com/users/thecartercenter/gists{/gist_id}","starred_url":"https://api.github.com/users/thecartercenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecartercenter/subscriptions","organizations_url":"https://api.github.com/users/thecartercenter/orgs","repos_url":"https://api.github.com/users/thecartercenter/repos","events_url":"https://api.github.com/users/thecartercenter/events{/privacy}","received_events_url":"https://api.github.com/users/thecartercenter/received_events","type":"Organization","site_admin":false},"repo":{"id":11615188,"name":"elmo","full_name":"thecartercenter/elmo","owner":{"login":"thecartercenter","id":5075178,"avatar_url":"https://avatars1.githubusercontent.com/u/5075178?v=4","gravatar_id":"","url":"https://api.github.com/users/thecartercenter","html_url":"https://github.com/thecartercenter","followers_url":"https://api.github.com/users/thecartercenter/followers","following_url":"https://api.github.com/users/thecartercenter/following{/other_user}","gists_url":"https://api.github.com/users/thecartercenter/gists{/gist_id}","starred_url":"https://api.github.com/users/thecartercenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thecartercenter/subscriptions","organizations_url":"https://api.github.com/users/thecartercenter/orgs","repos_url":"https://api.github.com/users/thecartercenter/repos","events_url":"https://api.github.com/users/thecartercenter/events{/privacy}","received_events_url":"https://api.github.com/users/thecartercenter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thecartercenter/elmo","description":null,"fork":false,"url":"https://api.github.com/repos/thecartercenter/elmo","forks_url":"https://api.github.com/repos/thecartercenter/elmo/forks","keys_url":"https://api.github.com/repos/thecartercenter/elmo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thecartercenter/elmo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thecartercenter/elmo/teams","hooks_url":"https://api.github.com/repos/thecartercenter/elmo/hooks","issue_events_url":"https://api.github.com/repos/thecartercenter/elmo/issues/events{/number}","events_url":"https://api.github.com/repos/thecartercenter/elmo/events","assignees_url":"https://api.github.com/repos/thecartercenter/elmo/assignees{/user}","branches_url":"https://api.github.com/repos/thecartercenter/elmo/branches{/branch}","tags_url":"https://api.github.com/repos/thecartercenter/elmo/tags","blobs_url":"https://api.github.com/repos/thecartercenter/elmo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thecartercenter/elmo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thecartercenter/elmo/git/refs{/sha}","trees_url":"https://api.github.com/repos/thecartercenter/elmo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thecartercenter/elmo/statuses/{sha}","languages_url":"https://api.github.com/repos/thecartercenter/elmo/languages","stargazers_url":"https://api.github.com/repos/thecartercenter/elmo/stargazers","contributors_url":"https://api.github.com/repos/thecartercenter/elmo/contributors","subscribers_url":"https://api.github.com/repos/thecartercenter/elmo/subscribers","subscription_url":"https://api.github.com/repos/thecartercenter/elmo/subscription","commits_url":"https://api.github.com/repos/thecartercenter/elmo/commits{/sha}","git_commits_url":"https://api.github.com/repos/thecartercenter/elmo/git/commits{/sha}","comments_url":"https://api.github.com/repos/thecartercenter/elmo/comments{/number}","issue_comment_url":"https://api.github.com/repos/thecartercenter/elmo/issues/comments{/number}","contents_url":"https://api.github.com/repos/thecartercenter/elmo/contents/{+path}","compare_url":"https://api.github.com/repos/thecartercenter/elmo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thecartercenter/elmo/merges","archive_url":"https://api.github.com/repos/thecartercenter/elmo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thecartercenter/elmo/downloads","issues_url":"https://api.github.com/repos/thecartercenter/elmo/issues{/number}","pulls_url":"https://api.github.com/repos/thecartercenter/elmo/pulls{/number}","milestones_url":"https://api.github.com/repos/thecartercenter/elmo/milestones{/number}","notifications_url":"https://api.github.com/repos/thecartercenter/elmo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thecartercenter/elmo/labels{/name}","releases_url":"https://api.github.com/repos/thecartercenter/elmo/releases{/id}","deployments_url":"https://api.github.com/repos/thecartercenter/elmo/deployments","created_at":"2013-07-23T17:56:04Z","updated_at":"2018-01-23T06:42:53Z","pushed_at":"2018-02-14T20:43:53Z","git_url":"git://github.com/thecartercenter/elmo.git","ssh_url":"git@github.com:thecartercenter/elmo.git","clone_url":"https://github.com/thecartercenter/elmo.git","svn_url":"https://github.com/thecartercenter/elmo","homepage":null,"size":70826,"stargazers_count":28,"watchers_count":28,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":37,"open_issues":6,"watchers":28,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/411"},"html":{"href":"https://github.com/thecartercenter/elmo/pull/411"},"issue":{"href":"https://api.github.com/repos/thecartercenter/elmo/issues/411"},"comments":{"href":"https://api.github.com/repos/thecartercenter/elmo/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thecartercenter/elmo/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/thecartercenter/elmo/statuses/201fbfc0d8f154a053ccaf8958d2b9595c19496c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}