{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/190730140","pull_request_review_id":123171544,"id":190730140,"diff_hunk":"@@ -223,6 +240,203 @@ protected ActionResult execute() throws EntityDoesNotExistException {\n         return createSpecificRedirectResult();\n     }\n \n+    private void updateResponsesComments(Map<String, String> commentsToUpdateId,\n+                                         Map<String, String> commentsToUpdateText,\n+                                         Map<String, String> responseGiverMapForComments,\n+                                         Map<String, String> responseRecipientMapForComments,\n+                                         Map<String, String> questionIdsForComments) {\n+        for (String commentIndex : commentsToUpdateId.keySet()) {\n+            String showCommentTo =\n+                    getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWCOMMENTSTO + commentIndex);\n+            String showGiverNameTo =\n+                    getRequestParamValue(Const.ParamsNames.RESPONSE_COMMENTS_SHOWGIVERTO + commentIndex);\n+            String commentId = commentsToUpdateId.get(commentIndex);\n+            String updatedCommentText = commentsToUpdateText.get(commentIndex);\n+            FeedbackResponseAttributes response =\n+                    logic.getFeedbackResponse(questionIdsForComments.get(commentIndex),\n+                            responseGiverMapForComments.get(commentIndex),\n+                            responseRecipientMapForComments.get(commentIndex));\n+            updateResponseComment(showCommentTo, showGiverNameTo, commentId, response, updatedCommentText);\n+\n+        }\n+    }\n+\n+    private void updateResponseComment(String showCommentTo, String showGiverNameTo, String commentId,\n+                                       FeedbackResponseAttributes response, String updatedCommentText) {\n+        FeedbackResponseCommentAttributes feedbackResponseComment = FeedbackResponseCommentAttributes\n+                .builder(courseId, feedbackSessionName, response.giver, new Text(updatedCommentText))\n+                .withCreatedAt(Instant.now())\n+                .withGiverSection(response.giverSection)\n+                .withReceiverSection(response.recipientSection)\n+                .build();\n+\n+        feedbackResponseComment.setId(Long.parseLong(commentId));\n+\n+        //Edit visibility settings\n+        feedbackResponseComment.showCommentTo = new ArrayList<>();\n+        if (showCommentTo != null && !showCommentTo.isEmpty()) {\n+            String[] showCommentToArray = showCommentTo.split(\",\");\n+            for (String viewer : showCommentToArray) {\n+                feedbackResponseComment.showCommentTo.add(FeedbackParticipantType.valueOf(viewer.trim()));\n+            }\n+        }\n+        feedbackResponseComment.showGiverNameTo = new ArrayList<>();\n+        if (showGiverNameTo != null && !showGiverNameTo.isEmpty()) {\n+            String[] showGiverNameToArray = showGiverNameTo.split(\",\");\n+            for (String viewer : showGiverNameToArray) {\n+                feedbackResponseComment.showGiverNameTo.add(FeedbackParticipantType.valueOf(viewer.trim()));\n+            }\n+        }\n+\n+        FeedbackResponseCommentAttributes updatedComment = null;\n+        try {\n+            updatedComment = logic.updateFeedbackResponseComment(feedbackResponseComment);\n+            //TODO: move putDocument to task queue\n+            logic.putDocument(updatedComment);\n+        } catch (InvalidParametersException e) {\n+            setStatusForException(e);\n+            isError = true;\n+        } catch (EntityDoesNotExistException e) {\n+            isError = true;\n+        }\n+\n+        if (!isError) {\n+            statusToAdmin += \"FeedbackSubmissionEditSaveAction:<br>\"","path":"src/main/java/teammates/ui/controller/FeedbackSubmissionEditSaveAction.java","position":124,"original_position":124,"commit_id":"57f7767ef7d97c8cb6f81a765a5c9169ac4e9ad4","original_commit_id":"606fe1282587f1c3db1592779346cc5a660d0693","user":{"login":"nidhi98gupta","id":24381442,"avatar_url":"https://avatars1.githubusercontent.com/u/24381442?v=4","gravatar_id":"","url":"https://api.github.com/users/nidhi98gupta","html_url":"https://github.com/nidhi98gupta","followers_url":"https://api.github.com/users/nidhi98gupta/followers","following_url":"https://api.github.com/users/nidhi98gupta/following{/other_user}","gists_url":"https://api.github.com/users/nidhi98gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/nidhi98gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nidhi98gupta/subscriptions","organizations_url":"https://api.github.com/users/nidhi98gupta/orgs","repos_url":"https://api.github.com/users/nidhi98gupta/repos","events_url":"https://api.github.com/users/nidhi98gupta/events{/privacy}","received_events_url":"https://api.github.com/users/nidhi98gupta/received_events","type":"User","site_admin":false},"body":"Since value of isError can be changed by many functions in this file, we cannot be sure that isError is false by putting it in try block?","created_at":"2018-05-24T21:03:26Z","updated_at":"2018-05-24T21:03:27Z","html_url":"https://github.com/TEAMMATES/teammates/pull/8830#discussion_r190730140","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/190730140"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/8830#discussion_r190730140"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830"}},"in_reply_to_id":190299398},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830","id":188076678,"html_url":"https://github.com/TEAMMATES/teammates/pull/8830","diff_url":"https://github.com/TEAMMATES/teammates/pull/8830.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/8830.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/8830","number":8830,"state":"open","locked":false,"title":"Student: submit responses: allow student to add a comment for each response #7239","user":{"login":"nidhi98gupta","id":24381442,"avatar_url":"https://avatars1.githubusercontent.com/u/24381442?v=4","gravatar_id":"","url":"https://api.github.com/users/nidhi98gupta","html_url":"https://github.com/nidhi98gupta","followers_url":"https://api.github.com/users/nidhi98gupta/followers","following_url":"https://api.github.com/users/nidhi98gupta/following{/other_user}","gists_url":"https://api.github.com/users/nidhi98gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/nidhi98gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nidhi98gupta/subscriptions","organizations_url":"https://api.github.com/users/nidhi98gupta/orgs","repos_url":"https://api.github.com/users/nidhi98gupta/repos","events_url":"https://api.github.com/users/nidhi98gupta/events{/privacy}","received_events_url":"https://api.github.com/users/nidhi98gupta/received_events","type":"User","site_admin":false},"body":"Fixes #7239\r\n\r\n@LuLechuan @whipermr5 I have started working on adding comments for MCQ type questions.\r\n\r\nWork ongoing.","created_at":"2018-05-15T10:07:43Z","updated_at":"2018-05-24T21:03:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f18f9b2f018b8a5b5cafe164bf2ad793c116c10c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/8830/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/57f7767ef7d97c8cb6f81a765a5c9169ac4e9ad4","head":{"label":"nidhi98gupta:7239-allow-student-to-add-comments-MCQ","ref":"7239-allow-student-to-add-comments-MCQ","sha":"57f7767ef7d97c8cb6f81a765a5c9169ac4e9ad4","user":{"login":"nidhi98gupta","id":24381442,"avatar_url":"https://avatars1.githubusercontent.com/u/24381442?v=4","gravatar_id":"","url":"https://api.github.com/users/nidhi98gupta","html_url":"https://github.com/nidhi98gupta","followers_url":"https://api.github.com/users/nidhi98gupta/followers","following_url":"https://api.github.com/users/nidhi98gupta/following{/other_user}","gists_url":"https://api.github.com/users/nidhi98gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/nidhi98gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nidhi98gupta/subscriptions","organizations_url":"https://api.github.com/users/nidhi98gupta/orgs","repos_url":"https://api.github.com/users/nidhi98gupta/repos","events_url":"https://api.github.com/users/nidhi98gupta/events{/privacy}","received_events_url":"https://api.github.com/users/nidhi98gupta/received_events","type":"User","site_admin":false},"repo":{"id":116410340,"name":"teammates","full_name":"nidhi98gupta/teammates","owner":{"login":"nidhi98gupta","id":24381442,"avatar_url":"https://avatars1.githubusercontent.com/u/24381442?v=4","gravatar_id":"","url":"https://api.github.com/users/nidhi98gupta","html_url":"https://github.com/nidhi98gupta","followers_url":"https://api.github.com/users/nidhi98gupta/followers","following_url":"https://api.github.com/users/nidhi98gupta/following{/other_user}","gists_url":"https://api.github.com/users/nidhi98gupta/gists{/gist_id}","starred_url":"https://api.github.com/users/nidhi98gupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nidhi98gupta/subscriptions","organizations_url":"https://api.github.com/users/nidhi98gupta/orgs","repos_url":"https://api.github.com/users/nidhi98gupta/repos","events_url":"https://api.github.com/users/nidhi98gupta/events{/privacy}","received_events_url":"https://api.github.com/users/nidhi98gupta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nidhi98gupta/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/nidhi98gupta/teammates","forks_url":"https://api.github.com/repos/nidhi98gupta/teammates/forks","keys_url":"https://api.github.com/repos/nidhi98gupta/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nidhi98gupta/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nidhi98gupta/teammates/teams","hooks_url":"https://api.github.com/repos/nidhi98gupta/teammates/hooks","issue_events_url":"https://api.github.com/repos/nidhi98gupta/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/nidhi98gupta/teammates/events","assignees_url":"https://api.github.com/repos/nidhi98gupta/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/nidhi98gupta/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/nidhi98gupta/teammates/tags","blobs_url":"https://api.github.com/repos/nidhi98gupta/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nidhi98gupta/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nidhi98gupta/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/nidhi98gupta/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nidhi98gupta/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/nidhi98gupta/teammates/languages","stargazers_url":"https://api.github.com/repos/nidhi98gupta/teammates/stargazers","contributors_url":"https://api.github.com/repos/nidhi98gupta/teammates/contributors","subscribers_url":"https://api.github.com/repos/nidhi98gupta/teammates/subscribers","subscription_url":"https://api.github.com/repos/nidhi98gupta/teammates/subscription","commits_url":"https://api.github.com/repos/nidhi98gupta/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/nidhi98gupta/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/nidhi98gupta/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/nidhi98gupta/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/nidhi98gupta/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/nidhi98gupta/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nidhi98gupta/teammates/merges","archive_url":"https://api.github.com/repos/nidhi98gupta/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nidhi98gupta/teammates/downloads","issues_url":"https://api.github.com/repos/nidhi98gupta/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/nidhi98gupta/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/nidhi98gupta/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/nidhi98gupta/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nidhi98gupta/teammates/labels{/name}","releases_url":"https://api.github.com/repos/nidhi98gupta/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/nidhi98gupta/teammates/deployments","created_at":"2018-01-05T17:32:44Z","updated_at":"2018-01-05T17:32:51Z","pushed_at":"2018-05-24T20:40:12Z","git_url":"git://github.com/nidhi98gupta/teammates.git","ssh_url":"git@github.com:nidhi98gupta/teammates.git","clone_url":"https://github.com/nidhi98gupta/teammates.git","svn_url":"https://github.com/nidhi98gupta/teammates","homepage":"https://teammatesv4.appspot.com/","size":197971,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TEAMMATES:master","ref":"master","sha":"ed1ea9c502db8a30e64d10f3b96e14c8428a124e","user":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars2.githubusercontent.com/u/7374810?v=4","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"repo":{"id":19369035,"name":"teammates","full_name":"TEAMMATES/teammates","owner":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars2.githubusercontent.com/u/7374810?v=4","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TEAMMATES/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":false,"url":"https://api.github.com/repos/TEAMMATES/teammates","forks_url":"https://api.github.com/repos/TEAMMATES/teammates/forks","keys_url":"https://api.github.com/repos/TEAMMATES/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TEAMMATES/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TEAMMATES/teammates/teams","hooks_url":"https://api.github.com/repos/TEAMMATES/teammates/hooks","issue_events_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/TEAMMATES/teammates/events","assignees_url":"https://api.github.com/repos/TEAMMATES/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/TEAMMATES/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/TEAMMATES/teammates/tags","blobs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TEAMMATES/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/TEAMMATES/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/TEAMMATES/teammates/languages","stargazers_url":"https://api.github.com/repos/TEAMMATES/teammates/stargazers","contributors_url":"https://api.github.com/repos/TEAMMATES/teammates/contributors","subscribers_url":"https://api.github.com/repos/TEAMMATES/teammates/subscribers","subscription_url":"https://api.github.com/repos/TEAMMATES/teammates/subscription","commits_url":"https://api.github.com/repos/TEAMMATES/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/TEAMMATES/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/TEAMMATES/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/TEAMMATES/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TEAMMATES/teammates/merges","archive_url":"https://api.github.com/repos/TEAMMATES/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TEAMMATES/teammates/downloads","issues_url":"https://api.github.com/repos/TEAMMATES/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/TEAMMATES/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/TEAMMATES/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TEAMMATES/teammates/labels{/name}","releases_url":"https://api.github.com/repos/TEAMMATES/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/TEAMMATES/teammates/deployments","created_at":"2014-05-02T07:43:00Z","updated_at":"2018-05-23T06:38:28Z","pushed_at":"2018-05-24T20:40:15Z","git_url":"git://github.com/TEAMMATES/teammates.git","ssh_url":"git@github.com:TEAMMATES/teammates.git","clone_url":"https://github.com/TEAMMATES/teammates.git","svn_url":"https://github.com/TEAMMATES/teammates","homepage":"https://teammatesv4.appspot.com/","size":197731,"stargazers_count":606,"watchers_count":606,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1423,"mirror_url":null,"archived":false,"open_issues_count":269,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1423,"open_issues":269,"watchers":606,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/8830"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/8830"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/8830/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/8830/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/57f7767ef7d97c8cb6f81a765a5c9169ac4e9ad4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nidhi98gupta"}}