{"action":"created","comment":{"url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/comments/116012376","pull_request_review_id":37601005,"id":116012376,"diff_hunk":"@@ -0,0 +1,255 @@\n+package org.opentestsystem.rdw.reporting.exam;\n+\n+import com.google.common.io.ByteStreams;\n+import org.opentestsystem.rdw.reporting.assessment.artifact.ArtifactRepository;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Service;\n+import org.w3c.dom.Document;\n+import org.w3c.dom.Node;\n+import org.w3c.dom.NodeList;\n+import org.xml.sax.SAXException;\n+\n+import javax.validation.constraints.NotNull;\n+import javax.xml.parsers.DocumentBuilder;\n+import javax.xml.parsers.DocumentBuilderFactory;\n+import javax.xml.parsers.ParserConfigurationException;\n+import javax.xml.xpath.XPath;\n+import javax.xml.xpath.XPathConstants;\n+import javax.xml.xpath.XPathExpression;\n+import javax.xml.xpath.XPathExpressionException;\n+import javax.xml.xpath.XPathFactory;\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.net.URLConnection;\n+import java.util.ArrayList;\n+import java.util.Base64;\n+import java.util.List;\n+import java.util.NoSuchElementException;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+import java.util.stream.Collectors;\n+import java.util.stream.IntStream;\n+\n+// TODO: Implement authorization\n+@Service\n+public class DefaultExamItemService implements ExamItemService {\n+\n+    private static final Logger logger = LoggerFactory.getLogger(DefaultExamItemService.class);\n+    private ArtifactRepository artifactRepository;\n+\n+    private DocumentBuilder documentBuilder;\n+    private XPathExpression rubricListPath;\n+    private XPathExpression answerKeyPath;\n+    private XPathExpression rubricPath;\n+    private XPathExpression primarySampleListPath;\n+    private XPathExpression secondarySampleListPath;\n+    private XPathExpression namePath;\n+    private XPathExpression valuePath;\n+    private XPathExpression descriptionPath;\n+    private XPathExpression scorePointPath;\n+    private XPathExpression sampleContentPath;\n+    private XPathExpression formatPath;\n+\n+    @Autowired\n+    public DefaultExamItemService(@NotNull final ArtifactRepository artifactRepository) throws XPathExpressionException, ParserConfigurationException {\n+        this.artifactRepository = artifactRepository;\n+\n+        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n+        documentBuilderFactory.setValidating(false);\n+        documentBuilderFactory.setIgnoringComments(false);\n+        documentBuilderFactory.setIgnoringElementContentWhitespace(true);\n+        documentBuilderFactory.setNamespaceAware(true);\n+        this.documentBuilder = documentBuilderFactory.newDocumentBuilder();\n+\n+        final XPath xPath = XPathFactory.newInstance().newXPath();\n+        this.rubricListPath = xPath.compile(\"/itemrelease/item/content/rubriclist\");\n+        this.answerKeyPath = xPath.compile(\"/itemrelease/item/attriblist/attrib[@attid=\\\"itm_att_Answer Key\\\"]\");\n+        this.rubricPath = xPath.compile(\"./rubric\");\n+        this.primarySampleListPath = xPath.compile(\"./samplelist\");\n+        this.secondarySampleListPath = xPath.compile(\"./samplelist/sample\");\n+        this.namePath = xPath.compile(\"./name\");\n+        this.valuePath = xPath.compile(\"./val\");\n+        this.descriptionPath = xPath.compile(\"./desc\");\n+        this.scorePointPath = xPath.compile(\"./@scorepoint\");\n+        this.sampleContentPath = xPath.compile(\"./samplecontent\");\n+        this.formatPath = xPath.compile(\"/itemrelease/item/@format\");\n+    }\n+\n+    @Override\n+    public ExamItemScoringGuide getScoringGuide(final String itemNumber) {\n+        try {\n+            return getExamItemSolution(getXmlDocument(itemNumber), itemNumber);\n+        } catch (IOException exception) {","path":"webapp/src/main/java/org/opentestsystem/rdw/reporting/exam/DefaultExamItemService.java","position":84,"original_position":84,"commit_id":"604bb36b854af67fedfaf50bc53fd4ad32f80757","original_commit_id":"604bb36b854af67fedfaf50bc53fd4ad32f80757","user":{"login":"malaffoon","id":5097710,"avatar_url":"https://avatars3.githubusercontent.com/u/5097710?v=3","gravatar_id":"","url":"https://api.github.com/users/malaffoon","html_url":"https://github.com/malaffoon","followers_url":"https://api.github.com/users/malaffoon/followers","following_url":"https://api.github.com/users/malaffoon/following{/other_user}","gists_url":"https://api.github.com/users/malaffoon/gists{/gist_id}","starred_url":"https://api.github.com/users/malaffoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malaffoon/subscriptions","organizations_url":"https://api.github.com/users/malaffoon/orgs","repos_url":"https://api.github.com/users/malaffoon/repos","events_url":"https://api.github.com/users/malaffoon/events{/privacy}","received_events_url":"https://api.github.com/users/malaffoon/received_events","type":"User","site_admin":false},"body":"nit: `final`","created_at":"2017-05-11T14:54:50Z","updated_at":"2017-05-11T14:54:50Z","html_url":"https://github.com/SmarterApp/RDW_Reporting/pull/81#discussion_r116012376","pull_request_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/comments/116012376"},"html":{"href":"https://github.com/SmarterApp/RDW_Reporting/pull/81#discussion_r116012376"},"pull_request":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81","id":120004839,"html_url":"https://github.com/SmarterApp/RDW_Reporting/pull/81","diff_url":"https://github.com/SmarterApp/RDW_Reporting/pull/81.diff","patch_url":"https://github.com/SmarterApp/RDW_Reporting/pull/81.patch","issue_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/81","number":81,"state":"open","locked":false,"title":"reporting cleanup round 2","user":{"login":"esotrope","id":23462925,"avatar_url":"https://avatars0.githubusercontent.com/u/23462925?v=3","gravatar_id":"","url":"https://api.github.com/users/esotrope","html_url":"https://github.com/esotrope","followers_url":"https://api.github.com/users/esotrope/followers","following_url":"https://api.github.com/users/esotrope/following{/other_user}","gists_url":"https://api.github.com/users/esotrope/gists{/gist_id}","starred_url":"https://api.github.com/users/esotrope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esotrope/subscriptions","organizations_url":"https://api.github.com/users/esotrope/orgs","repos_url":"https://api.github.com/users/esotrope/repos","events_url":"https://api.github.com/users/esotrope/events{/privacy}","received_events_url":"https://api.github.com/users/esotrope/received_events","type":"User","site_admin":false},"body":"1. cleaned up DefaultExamItemService & unit test \r\n2. moves controllers to web package.\r\n3. creates assessment, exam, exam.report, exam.report.export packages and moves to these new packages.\r\n","created_at":"2017-05-11T00:23:00Z","updated_at":"2017-05-11T14:54:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"427c4848dfe4af17e3cc17c83a44951b1fa7eb03","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bgsavage","id":5771116,"avatar_url":"https://avatars1.githubusercontent.com/u/5771116?v=3","gravatar_id":"","url":"https://api.github.com/users/bgsavage","html_url":"https://github.com/bgsavage","followers_url":"https://api.github.com/users/bgsavage/followers","following_url":"https://api.github.com/users/bgsavage/following{/other_user}","gists_url":"https://api.github.com/users/bgsavage/gists{/gist_id}","starred_url":"https://api.github.com/users/bgsavage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgsavage/subscriptions","organizations_url":"https://api.github.com/users/bgsavage/orgs","repos_url":"https://api.github.com/users/bgsavage/repos","events_url":"https://api.github.com/users/bgsavage/events{/privacy}","received_events_url":"https://api.github.com/users/bgsavage/received_events","type":"User","site_admin":false},{"login":"agorina","id":16457484,"avatar_url":"https://avatars1.githubusercontent.com/u/16457484?v=3","gravatar_id":"","url":"https://api.github.com/users/agorina","html_url":"https://github.com/agorina","followers_url":"https://api.github.com/users/agorina/followers","following_url":"https://api.github.com/users/agorina/following{/other_user}","gists_url":"https://api.github.com/users/agorina/gists{/gist_id}","starred_url":"https://api.github.com/users/agorina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agorina/subscriptions","organizations_url":"https://api.github.com/users/agorina/orgs","repos_url":"https://api.github.com/users/agorina/repos","events_url":"https://api.github.com/users/agorina/events{/privacy}","received_events_url":"https://api.github.com/users/agorina/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81/commits","review_comments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81/comments","review_comment_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/81/comments","statuses_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/statuses/604bb36b854af67fedfaf50bc53fd4ad32f80757","head":{"label":"SmarterApp:feature/cleanup2","ref":"feature/cleanup2","sha":"604bb36b854af67fedfaf50bc53fd4ad32f80757","user":{"login":"SmarterApp","id":7026395,"avatar_url":"https://avatars3.githubusercontent.com/u/7026395?v=3","gravatar_id":"","url":"https://api.github.com/users/SmarterApp","html_url":"https://github.com/SmarterApp","followers_url":"https://api.github.com/users/SmarterApp/followers","following_url":"https://api.github.com/users/SmarterApp/following{/other_user}","gists_url":"https://api.github.com/users/SmarterApp/gists{/gist_id}","starred_url":"https://api.github.com/users/SmarterApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmarterApp/subscriptions","organizations_url":"https://api.github.com/users/SmarterApp/orgs","repos_url":"https://api.github.com/users/SmarterApp/repos","events_url":"https://api.github.com/users/SmarterApp/events{/privacy}","received_events_url":"https://api.github.com/users/SmarterApp/received_events","type":"Organization","site_admin":false},"repo":{"id":81362154,"name":"RDW_Reporting","full_name":"SmarterApp/RDW_Reporting","owner":{"login":"SmarterApp","id":7026395,"avatar_url":"https://avatars3.githubusercontent.com/u/7026395?v=3","gravatar_id":"","url":"https://api.github.com/users/SmarterApp","html_url":"https://github.com/SmarterApp","followers_url":"https://api.github.com/users/SmarterApp/followers","following_url":"https://api.github.com/users/SmarterApp/following{/other_user}","gists_url":"https://api.github.com/users/SmarterApp/gists{/gist_id}","starred_url":"https://api.github.com/users/SmarterApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmarterApp/subscriptions","organizations_url":"https://api.github.com/users/SmarterApp/orgs","repos_url":"https://api.github.com/users/SmarterApp/repos","events_url":"https://api.github.com/users/SmarterApp/events{/privacy}","received_events_url":"https://api.github.com/users/SmarterApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SmarterApp/RDW_Reporting","description":"RDW reporting tier (web app, backend services, etc.)","fork":false,"url":"https://api.github.com/repos/SmarterApp/RDW_Reporting","forks_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/forks","keys_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/teams","hooks_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/hooks","issue_events_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/events{/number}","events_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/events","assignees_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/assignees{/user}","branches_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/branches{/branch}","tags_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/tags","blobs_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/refs{/sha}","trees_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/statuses/{sha}","languages_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/languages","stargazers_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/stargazers","contributors_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/contributors","subscribers_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/subscribers","subscription_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/subscription","commits_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/commits{/sha}","git_commits_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/commits{/sha}","comments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/comments{/number}","issue_comment_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/comments{/number}","contents_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/contents/{+path}","compare_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/merges","archive_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/downloads","issues_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues{/number}","pulls_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls{/number}","milestones_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/milestones{/number}","notifications_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/labels{/name}","releases_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/releases{/id}","deployments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/deployments","created_at":"2017-02-08T18:31:23Z","updated_at":"2017-03-27T22:25:19Z","pushed_at":"2017-05-11T00:23:00Z","git_url":"git://github.com/SmarterApp/RDW_Reporting.git","ssh_url":"git@github.com:SmarterApp/RDW_Reporting.git","clone_url":"https://github.com/SmarterApp/RDW_Reporting.git","svn_url":"https://github.com/SmarterApp/RDW_Reporting","homepage":null,"size":3868,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"SmarterApp:develop","ref":"develop","sha":"336314ea8884bf20b7cfc9452068ab7e9c8ccf86","user":{"login":"SmarterApp","id":7026395,"avatar_url":"https://avatars3.githubusercontent.com/u/7026395?v=3","gravatar_id":"","url":"https://api.github.com/users/SmarterApp","html_url":"https://github.com/SmarterApp","followers_url":"https://api.github.com/users/SmarterApp/followers","following_url":"https://api.github.com/users/SmarterApp/following{/other_user}","gists_url":"https://api.github.com/users/SmarterApp/gists{/gist_id}","starred_url":"https://api.github.com/users/SmarterApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmarterApp/subscriptions","organizations_url":"https://api.github.com/users/SmarterApp/orgs","repos_url":"https://api.github.com/users/SmarterApp/repos","events_url":"https://api.github.com/users/SmarterApp/events{/privacy}","received_events_url":"https://api.github.com/users/SmarterApp/received_events","type":"Organization","site_admin":false},"repo":{"id":81362154,"name":"RDW_Reporting","full_name":"SmarterApp/RDW_Reporting","owner":{"login":"SmarterApp","id":7026395,"avatar_url":"https://avatars3.githubusercontent.com/u/7026395?v=3","gravatar_id":"","url":"https://api.github.com/users/SmarterApp","html_url":"https://github.com/SmarterApp","followers_url":"https://api.github.com/users/SmarterApp/followers","following_url":"https://api.github.com/users/SmarterApp/following{/other_user}","gists_url":"https://api.github.com/users/SmarterApp/gists{/gist_id}","starred_url":"https://api.github.com/users/SmarterApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SmarterApp/subscriptions","organizations_url":"https://api.github.com/users/SmarterApp/orgs","repos_url":"https://api.github.com/users/SmarterApp/repos","events_url":"https://api.github.com/users/SmarterApp/events{/privacy}","received_events_url":"https://api.github.com/users/SmarterApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SmarterApp/RDW_Reporting","description":"RDW reporting tier (web app, backend services, etc.)","fork":false,"url":"https://api.github.com/repos/SmarterApp/RDW_Reporting","forks_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/forks","keys_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/teams","hooks_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/hooks","issue_events_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/events{/number}","events_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/events","assignees_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/assignees{/user}","branches_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/branches{/branch}","tags_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/tags","blobs_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/refs{/sha}","trees_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/statuses/{sha}","languages_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/languages","stargazers_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/stargazers","contributors_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/contributors","subscribers_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/subscribers","subscription_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/subscription","commits_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/commits{/sha}","git_commits_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/git/commits{/sha}","comments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/comments{/number}","issue_comment_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/comments{/number}","contents_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/contents/{+path}","compare_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/merges","archive_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/downloads","issues_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues{/number}","pulls_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls{/number}","milestones_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/milestones{/number}","notifications_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/labels{/name}","releases_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/releases{/id}","deployments_url":"https://api.github.com/repos/SmarterApp/RDW_Reporting/deployments","created_at":"2017-02-08T18:31:23Z","updated_at":"2017-03-27T22:25:19Z","pushed_at":"2017-05-11T00:23:00Z","git_url":"git://github.com/SmarterApp/RDW_Reporting.git","ssh_url":"git@github.com:SmarterApp/RDW_Reporting.git","clone_url":"https://github.com/SmarterApp/RDW_Reporting.git","svn_url":"https://github.com/SmarterApp/RDW_Reporting","homepage":null,"size":3868,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81"},"html":{"href":"https://github.com/SmarterApp/RDW_Reporting/pull/81"},"issue":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/81"},"comments":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/SmarterApp/RDW_Reporting/statuses/604bb36b854af67fedfaf50bc53fd4ad32f80757"}}}}
{"actor":{"display_login":"malaffoon"}}