{"action":"created","comment":{"url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/comments/116771058","pull_request_review_id":38418445,"id":116771058,"diff_hunk":"@@ -93,6 +117,68 @@ public ModelAndView synchronizeWithCanvas(@PathVariable String sectionId) throws\n         return page;\n     }\n \n+    @RequestMapping(value = \"/{sectionId}/save\", params = \"pushGradesToCanvas\", method = RequestMethod.POST)\n+    public ModelAndView pushGradesToCanvas(@PathVariable Long sectionId, @ModelAttribute(\"courseConfigurationForm\") @Valid CourseConfigurationForm classSetupForm, BindingResult bindingResult) throws NoLtiSessionException{\n+        validator.validate(classSetupForm, bindingResult);\n+        if (bindingResult.hasErrors()) {\n+            ModelAndView page = new ModelAndView(\"/courseConfiguration\");\n+            List<String> errors = new ArrayList<>();\n+            bindingResult.getFieldErrors().forEach(error -> errors.add(error.getCode()));\n+            page.addObject(\"error\", errors);\n+            page.addObject(\"selectedSectionId\", sectionId);\n+            return page;\n+        } else {\n+            LOG.info(\"eid: \" + canvasService.getEid() + \" is pushing grades for course # \" + canvasService.getCourseId() + \" to Canvas\");\n+            ModelAndView page = new ModelAndView(\"forward:/courseConfiguration/\" + sectionId);\n+\n+            Long courseId = Long.valueOf(canvasService.getCourseId());\n+\n+            boolean isSimpleAttendance = classSetupForm.getSimpleAttendance();\n+            List<AttendanceSummaryModel> summaryForSections = isSimpleAttendance ?\n+                    reportService.getSimpleAttendanceSummaryReport(sectionId) :\n+                    reportService.getAviationAttendanceSummaryReport(sectionId);\n+\n+            AttendanceAssignment assignmentConfigurationFromSetup = generateAssignmentFromClassSetupForm(classSetupForm);\n+            try {\n+                assignmentSubmitter.submitCourseAttendances(isSimpleAttendance, summaryForSections, courseId, canvasService.getOauthToken(), assignmentConfigurationFromSetup);\n+                page.addObject(\"pushingSuccessful\", true);\n+\n+            } catch (Exception submissionErrors) {","path":"src/main/java/edu/ksu/canvas/attendance/controller/CourseConfigurationController.java","position":103,"original_position":103,"commit_id":"cbb310500ac36b1b4f7bd0a47a5c044acace9ec7","original_commit_id":"cbb310500ac36b1b4f7bd0a47a5c044acace9ec7","user":{"login":"KSU-Github","id":5263239,"avatar_url":"https://avatars0.githubusercontent.com/u/5263239?v=3","gravatar_id":"","url":"https://api.github.com/users/KSU-Github","html_url":"https://github.com/KSU-Github","followers_url":"https://api.github.com/users/KSU-Github/followers","following_url":"https://api.github.com/users/KSU-Github/following{/other_user}","gists_url":"https://api.github.com/users/KSU-Github/gists{/gist_id}","starred_url":"https://api.github.com/users/KSU-Github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KSU-Github/subscriptions","organizations_url":"https://api.github.com/users/KSU-Github/orgs","repos_url":"https://api.github.com/users/KSU-Github/repos","events_url":"https://api.github.com/users/KSU-Github/events{/privacy}","received_events_url":"https://api.github.com/users/KSU-Github/received_events","type":"User","site_admin":false},"body":"![CRITICAL](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-critical.png) Either log or rethrow this exception. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://sonar.ome.ksu.edu/coding_rules#rule_key=squid%3AS1166)\n","created_at":"2017-05-16T15:10:41Z","updated_at":"2017-05-16T15:10:41Z","html_url":"https://github.com/kstateome/lti-attendance/pull/163#discussion_r116771058","pull_request_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163","_links":{"self":{"href":"https://api.github.com/repos/kstateome/lti-attendance/pulls/comments/116771058"},"html":{"href":"https://github.com/kstateome/lti-attendance/pull/163#discussion_r116771058"},"pull_request":{"href":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163"}}},"pull_request":{"url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163","id":119912565,"html_url":"https://github.com/kstateome/lti-attendance/pull/163","diff_url":"https://github.com/kstateome/lti-attendance/pull/163.diff","patch_url":"https://github.com/kstateome/lti-attendance/pull/163.patch","issue_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/163","number":163,"state":"open","locked":false,"title":"Lk1413","user":{"login":"jesusorrksu","id":14843645,"avatar_url":"https://avatars1.githubusercontent.com/u/14843645?v=3","gravatar_id":"","url":"https://api.github.com/users/jesusorrksu","html_url":"https://github.com/jesusorrksu","followers_url":"https://api.github.com/users/jesusorrksu/followers","following_url":"https://api.github.com/users/jesusorrksu/following{/other_user}","gists_url":"https://api.github.com/users/jesusorrksu/gists{/gist_id}","starred_url":"https://api.github.com/users/jesusorrksu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesusorrksu/subscriptions","organizations_url":"https://api.github.com/users/jesusorrksu/orgs","repos_url":"https://api.github.com/users/jesusorrksu/repos","events_url":"https://api.github.com/users/jesusorrksu/events{/privacy}","received_events_url":"https://api.github.com/users/jesusorrksu/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-10T15:30:17Z","updated_at":"2017-05-16T15:10:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c15c57f98def96e3ec0e8856ddb0e548bc03dc5b","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163/commits","review_comments_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163/comments","review_comment_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/163/comments","statuses_url":"https://api.github.com/repos/kstateome/lti-attendance/statuses/cbb310500ac36b1b4f7bd0a47a5c044acace9ec7","head":{"label":"kstateome:lk1413","ref":"lk1413","sha":"cbb310500ac36b1b4f7bd0a47a5c044acace9ec7","user":{"login":"kstateome","id":669649,"avatar_url":"https://avatars3.githubusercontent.com/u/669649?v=3","gravatar_id":"","url":"https://api.github.com/users/kstateome","html_url":"https://github.com/kstateome","followers_url":"https://api.github.com/users/kstateome/followers","following_url":"https://api.github.com/users/kstateome/following{/other_user}","gists_url":"https://api.github.com/users/kstateome/gists{/gist_id}","starred_url":"https://api.github.com/users/kstateome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kstateome/subscriptions","organizations_url":"https://api.github.com/users/kstateome/orgs","repos_url":"https://api.github.com/users/kstateome/repos","events_url":"https://api.github.com/users/kstateome/events{/privacy}","received_events_url":"https://api.github.com/users/kstateome/received_events","type":"Organization","site_admin":false},"repo":{"id":56523179,"name":"lti-attendance","full_name":"kstateome/lti-attendance","owner":{"login":"kstateome","id":669649,"avatar_url":"https://avatars3.githubusercontent.com/u/669649?v=3","gravatar_id":"","url":"https://api.github.com/users/kstateome","html_url":"https://github.com/kstateome","followers_url":"https://api.github.com/users/kstateome/followers","following_url":"https://api.github.com/users/kstateome/following{/other_user}","gists_url":"https://api.github.com/users/kstateome/gists{/gist_id}","starred_url":"https://api.github.com/users/kstateome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kstateome/subscriptions","organizations_url":"https://api.github.com/users/kstateome/orgs","repos_url":"https://api.github.com/users/kstateome/repos","events_url":"https://api.github.com/users/kstateome/events{/privacy}","received_events_url":"https://api.github.com/users/kstateome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kstateome/lti-attendance","description":"LTI application for keeping track of student attendance in Canvas courses","fork":false,"url":"https://api.github.com/repos/kstateome/lti-attendance","forks_url":"https://api.github.com/repos/kstateome/lti-attendance/forks","keys_url":"https://api.github.com/repos/kstateome/lti-attendance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kstateome/lti-attendance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kstateome/lti-attendance/teams","hooks_url":"https://api.github.com/repos/kstateome/lti-attendance/hooks","issue_events_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/events{/number}","events_url":"https://api.github.com/repos/kstateome/lti-attendance/events","assignees_url":"https://api.github.com/repos/kstateome/lti-attendance/assignees{/user}","branches_url":"https://api.github.com/repos/kstateome/lti-attendance/branches{/branch}","tags_url":"https://api.github.com/repos/kstateome/lti-attendance/tags","blobs_url":"https://api.github.com/repos/kstateome/lti-attendance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kstateome/lti-attendance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kstateome/lti-attendance/git/refs{/sha}","trees_url":"https://api.github.com/repos/kstateome/lti-attendance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kstateome/lti-attendance/statuses/{sha}","languages_url":"https://api.github.com/repos/kstateome/lti-attendance/languages","stargazers_url":"https://api.github.com/repos/kstateome/lti-attendance/stargazers","contributors_url":"https://api.github.com/repos/kstateome/lti-attendance/contributors","subscribers_url":"https://api.github.com/repos/kstateome/lti-attendance/subscribers","subscription_url":"https://api.github.com/repos/kstateome/lti-attendance/subscription","commits_url":"https://api.github.com/repos/kstateome/lti-attendance/commits{/sha}","git_commits_url":"https://api.github.com/repos/kstateome/lti-attendance/git/commits{/sha}","comments_url":"https://api.github.com/repos/kstateome/lti-attendance/comments{/number}","issue_comment_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/comments{/number}","contents_url":"https://api.github.com/repos/kstateome/lti-attendance/contents/{+path}","compare_url":"https://api.github.com/repos/kstateome/lti-attendance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kstateome/lti-attendance/merges","archive_url":"https://api.github.com/repos/kstateome/lti-attendance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kstateome/lti-attendance/downloads","issues_url":"https://api.github.com/repos/kstateome/lti-attendance/issues{/number}","pulls_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls{/number}","milestones_url":"https://api.github.com/repos/kstateome/lti-attendance/milestones{/number}","notifications_url":"https://api.github.com/repos/kstateome/lti-attendance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kstateome/lti-attendance/labels{/name}","releases_url":"https://api.github.com/repos/kstateome/lti-attendance/releases{/id}","deployments_url":"https://api.github.com/repos/kstateome/lti-attendance/deployments","created_at":"2016-04-18T16:17:38Z","updated_at":"2017-03-28T00:25:17Z","pushed_at":"2017-05-16T15:08:07Z","git_url":"git://github.com/kstateome/lti-attendance.git","ssh_url":"git@github.com:kstateome/lti-attendance.git","clone_url":"https://github.com/kstateome/lti-attendance.git","svn_url":"https://github.com/kstateome/lti-attendance","homepage":"","size":1556,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"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":"kstateome:merge-34N","ref":"merge-34N","sha":"dfad0e6a2a45a388a89ab53c8c74bbeee17d7eb2","user":{"login":"kstateome","id":669649,"avatar_url":"https://avatars3.githubusercontent.com/u/669649?v=3","gravatar_id":"","url":"https://api.github.com/users/kstateome","html_url":"https://github.com/kstateome","followers_url":"https://api.github.com/users/kstateome/followers","following_url":"https://api.github.com/users/kstateome/following{/other_user}","gists_url":"https://api.github.com/users/kstateome/gists{/gist_id}","starred_url":"https://api.github.com/users/kstateome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kstateome/subscriptions","organizations_url":"https://api.github.com/users/kstateome/orgs","repos_url":"https://api.github.com/users/kstateome/repos","events_url":"https://api.github.com/users/kstateome/events{/privacy}","received_events_url":"https://api.github.com/users/kstateome/received_events","type":"Organization","site_admin":false},"repo":{"id":56523179,"name":"lti-attendance","full_name":"kstateome/lti-attendance","owner":{"login":"kstateome","id":669649,"avatar_url":"https://avatars3.githubusercontent.com/u/669649?v=3","gravatar_id":"","url":"https://api.github.com/users/kstateome","html_url":"https://github.com/kstateome","followers_url":"https://api.github.com/users/kstateome/followers","following_url":"https://api.github.com/users/kstateome/following{/other_user}","gists_url":"https://api.github.com/users/kstateome/gists{/gist_id}","starred_url":"https://api.github.com/users/kstateome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kstateome/subscriptions","organizations_url":"https://api.github.com/users/kstateome/orgs","repos_url":"https://api.github.com/users/kstateome/repos","events_url":"https://api.github.com/users/kstateome/events{/privacy}","received_events_url":"https://api.github.com/users/kstateome/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kstateome/lti-attendance","description":"LTI application for keeping track of student attendance in Canvas courses","fork":false,"url":"https://api.github.com/repos/kstateome/lti-attendance","forks_url":"https://api.github.com/repos/kstateome/lti-attendance/forks","keys_url":"https://api.github.com/repos/kstateome/lti-attendance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kstateome/lti-attendance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kstateome/lti-attendance/teams","hooks_url":"https://api.github.com/repos/kstateome/lti-attendance/hooks","issue_events_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/events{/number}","events_url":"https://api.github.com/repos/kstateome/lti-attendance/events","assignees_url":"https://api.github.com/repos/kstateome/lti-attendance/assignees{/user}","branches_url":"https://api.github.com/repos/kstateome/lti-attendance/branches{/branch}","tags_url":"https://api.github.com/repos/kstateome/lti-attendance/tags","blobs_url":"https://api.github.com/repos/kstateome/lti-attendance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kstateome/lti-attendance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kstateome/lti-attendance/git/refs{/sha}","trees_url":"https://api.github.com/repos/kstateome/lti-attendance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kstateome/lti-attendance/statuses/{sha}","languages_url":"https://api.github.com/repos/kstateome/lti-attendance/languages","stargazers_url":"https://api.github.com/repos/kstateome/lti-attendance/stargazers","contributors_url":"https://api.github.com/repos/kstateome/lti-attendance/contributors","subscribers_url":"https://api.github.com/repos/kstateome/lti-attendance/subscribers","subscription_url":"https://api.github.com/repos/kstateome/lti-attendance/subscription","commits_url":"https://api.github.com/repos/kstateome/lti-attendance/commits{/sha}","git_commits_url":"https://api.github.com/repos/kstateome/lti-attendance/git/commits{/sha}","comments_url":"https://api.github.com/repos/kstateome/lti-attendance/comments{/number}","issue_comment_url":"https://api.github.com/repos/kstateome/lti-attendance/issues/comments{/number}","contents_url":"https://api.github.com/repos/kstateome/lti-attendance/contents/{+path}","compare_url":"https://api.github.com/repos/kstateome/lti-attendance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kstateome/lti-attendance/merges","archive_url":"https://api.github.com/repos/kstateome/lti-attendance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kstateome/lti-attendance/downloads","issues_url":"https://api.github.com/repos/kstateome/lti-attendance/issues{/number}","pulls_url":"https://api.github.com/repos/kstateome/lti-attendance/pulls{/number}","milestones_url":"https://api.github.com/repos/kstateome/lti-attendance/milestones{/number}","notifications_url":"https://api.github.com/repos/kstateome/lti-attendance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kstateome/lti-attendance/labels{/name}","releases_url":"https://api.github.com/repos/kstateome/lti-attendance/releases{/id}","deployments_url":"https://api.github.com/repos/kstateome/lti-attendance/deployments","created_at":"2016-04-18T16:17:38Z","updated_at":"2017-03-28T00:25:17Z","pushed_at":"2017-05-16T15:08:07Z","git_url":"git://github.com/kstateome/lti-attendance.git","ssh_url":"git@github.com:kstateome/lti-attendance.git","clone_url":"https://github.com/kstateome/lti-attendance.git","svn_url":"https://github.com/kstateome/lti-attendance","homepage":"","size":1556,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"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/kstateome/lti-attendance/pulls/163"},"html":{"href":"https://github.com/kstateome/lti-attendance/pull/163"},"issue":{"href":"https://api.github.com/repos/kstateome/lti-attendance/issues/163"},"comments":{"href":"https://api.github.com/repos/kstateome/lti-attendance/issues/163/comments"},"review_comments":{"href":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163/comments"},"review_comment":{"href":"https://api.github.com/repos/kstateome/lti-attendance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kstateome/lti-attendance/pulls/163/commits"},"statuses":{"href":"https://api.github.com/repos/kstateome/lti-attendance/statuses/cbb310500ac36b1b4f7bd0a47a5c044acace9ec7"}}}}
{"actor":{"display_login":"KSU-Github"}}