{"action":"created","comment":{"url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/comments/36480556","id":36480556,"diff_hunk":"@@ -0,0 +1,279 @@\n+package org.sakaiproject.gradebookng.tool.panels;\n+\n+import org.apache.commons.lang.StringUtils;\n+import org.apache.wicket.AttributeModifier;\n+import org.apache.wicket.ajax.AjaxRequestTarget;\n+import org.apache.wicket.ajax.markup.html.AjaxLink;\n+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;\n+import org.apache.wicket.markup.html.WebMarkupContainer;\n+import org.apache.wicket.markup.html.basic.Label;\n+import org.apache.wicket.markup.html.list.ListItem;\n+import org.apache.wicket.markup.html.list.ListView;\n+import org.apache.wicket.markup.html.panel.Panel;\n+import org.apache.wicket.model.IModel;\n+import org.apache.wicket.model.StringResourceModel;\n+import org.apache.wicket.spring.injection.annot.SpringBean;\n+import org.sakaiproject.gradebookng.business.GradebookNgBusinessService;\n+import org.sakaiproject.gradebookng.business.model.GbGradeInfo;\n+import org.sakaiproject.gradebookng.business.model.GbStudentGradeInfo;\n+import org.sakaiproject.gradebookng.tool.pages.GradebookPage;\n+import org.sakaiproject.service.gradebook.shared.Assignment;\n+import org.sakaiproject.service.gradebook.shared.CategoryDefinition;\n+import org.sakaiproject.tool.gradebook.Gradebook;\n+\n+import java.text.SimpleDateFormat;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Date;\n+import java.util.Collections;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.Iterator;\n+\n+public class StudentGradeSummaryGradesPanel extends Panel {\n+\n+\tpublic static enum VIEW {\n+\t\tINSTRUCTOR,\n+\t\tSTUDENT\n+\t}\n+\n+\tprivate VIEW view;\n+\n+\tprivate static final long serialVersionUID = 1L;\n+\t\n+\tprivate GbStudentGradeInfo gradeInfo;\n+\tprivate List<CategoryDefinition> categories;\n+\t\n+\t@SpringBean(name=\"org.sakaiproject.gradebookng.business.GradebookNgBusinessService\")\n+\tprotected GradebookNgBusinessService businessService;\n+\t\n+\tpublic StudentGradeSummaryGradesPanel(String id, IModel<Map<String, Object>> model, VIEW view) {\n+\t\tsuper(id, model);\n+\n+\t\tthis.view = view;\n+\t}\n+\t\n+\t@Override\n+\tpublic void onInitialize() {\n+\t\tsuper.onInitialize();\n+\t\t\n+\t\t//unpack model\n+\t\tMap<String,Object> modelData = (Map<String,Object>) this.getDefaultModelObject();\n+\t\tString userId = (String) modelData.get(\"userId\");\n+\t\tString displayName = (String) modelData.get(\"displayName\");\n+\t\t\n+\t\t//build the grade matrix for the user\n+\t\tfinal List<Assignment> assignments = this.businessService.getGradebookAssignments();\n+        \n+\t\t//TODO catch if this is null, the get(0) will throw an exception\n+\t\t//TODO also catch the GbException\n+\t\tthis.gradeInfo = this.businessService.buildGradeMatrix(assignments, Collections.singletonList(userId)).get(0);\n+\t\tthis.categories = this.businessService.getGradebookCategories();\n+\n+\t\tfinal List<String> categoryNames = new ArrayList<String>();\n+\t\tfinal Map<String, List<Assignment>> categoriesToAssignments = new HashMap<String, List<Assignment>>();\n+\n+\t\tIterator<Assignment> assignmentIterator = assignments.iterator();\n+\t\twhile (assignmentIterator.hasNext()) {\n+\t\t\tAssignment assignment = assignmentIterator.next();\n+\t\t\tString category = assignment.getCategoryName() == null ? GradebookPage.UNCATEGORIZED : assignment.getCategoryName();\n+\n+\t\t\tif (!categoriesToAssignments.containsKey(category)) {\n+\t\t\t\tcategoryNames.add(category);\n+\t\t\t\tcategoriesToAssignments.put(category, new ArrayList<Assignment>());\n+\t\t\t}\n+\n+\t\t\tcategoriesToAssignments.get(category).add(assignment);\n+\t\t}\n+\n+\t\tCollections.sort(categoryNames);\n+\n+\t\tfinal boolean[] categoryScoreHidden = { false };\n+\n+\t\tadd(new ListView<String>(\"categoriesList\", categoryNames) {\n+\t\t\tprivate static final long serialVersionUID = 1L;\n+\n+\t\t\t@Override\n+\t\t\tprotected void populateItem(ListItem<String> categoryItem) {\n+\t\t\t\tfinal String category = categoryItem.getModelObject();\n+\n+\t\t\t\tList<Assignment> categoryAssignments = categoriesToAssignments.get(category);\n+\n+\t\t\t\tcategoryItem.add(new Label(\"category\", category));\n+\n+\t\t\t\tCategoryDefinition categoryDefinition = null;\n+\t\t\t\tfor (CategoryDefinition aCategoryDefinition : categories) {\n+\t\t\t\t\tif (aCategoryDefinition.getName().equals(category)) {\n+\t\t\t\t\t\tcategoryDefinition = aCategoryDefinition;\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t\t\tif (categoryDefinition != null) {\n+\t\t\t\t\tboolean allAssignmentsAreReleased = true;\n+\t\t\t\t\tfor (Assignment assignment : categoryAssignments) {\n+\t\t\t\t\t\tif (!assignment.isReleased()) {\n+\t\t\t\t\t\t\tallAssignmentsAreReleased = false;\n+\t\t\t\t\t\t\tbreak;\n+\t\t\t\t\t\t}\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tif (isInstructorView() || allAssignmentsAreReleased) {\n+\t\t\t\t\t\tDouble score = gradeInfo.getCategoryAverages().get(categoryDefinition.getId());\n+\t\t\t\t\t\tString grade = \"\";\n+\t\t\t\t\t\tif (score != null) {\n+\t\t\t\t\t\t\tgrade = CategoryColumnCellPanel.formatDouble(score);\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\tcategoryItem.add(new Label(\"categoryGrade\", grade));\n+\n+\t\t\t\t\t\tString weight = \"\";\n+\t\t\t\t\t\tif (categoryDefinition.getWeight() == null) {\n+\t\t\t\t\t\t\tweight = CategoryColumnCellPanel.formatDouble(categoryDefinition.getWeight());","path":"tool/src/java/org/sakaiproject/gradebookng/tool/panels/StudentGradeSummaryGradesPanel.java","position":131,"original_position":131,"commit_id":"05448c0680018bd0a295c4eeda3af97f6ef3b487","original_commit_id":"05448c0680018bd0a295c4eeda3af97f6ef3b487","user":{"login":"payten","id":608337,"avatar_url":"https://avatars.githubusercontent.com/u/608337?v=3","gravatar_id":"","url":"https://api.github.com/users/payten","html_url":"https://github.com/payten","followers_url":"https://api.github.com/users/payten/followers","following_url":"https://api.github.com/users/payten/following{/other_user}","gists_url":"https://api.github.com/users/payten/gists{/gist_id}","starred_url":"https://api.github.com/users/payten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payten/subscriptions","organizations_url":"https://api.github.com/users/payten/orgs","repos_url":"https://api.github.com/users/payten/repos","events_url":"https://api.github.com/users/payten/events{/privacy}","received_events_url":"https://api.github.com/users/payten/received_events","type":"User","site_admin":false},"body":"Ah yep.  Should we move `formatDouble` to a helper class or to the page?","created_at":"2015-08-07T00:07:30Z","updated_at":"2015-08-07T00:07:30Z","html_url":"https://github.com/steveswinsburg/gradebookNG/pull/170#discussion_r36480556","pull_request_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/comments/36480556"},"html":{"href":"https://github.com/steveswinsburg/gradebookNG/pull/170#discussion_r36480556"},"pull_request":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170","id":41533711,"html_url":"https://github.com/steveswinsburg/gradebookNG/pull/170","diff_url":"https://github.com/steveswinsburg/gradebookNG/pull/170.diff","patch_url":"https://github.com/steveswinsburg/gradebookNG/pull/170.patch","issue_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/170","number":170,"state":"closed","locked":false,"title":"Student grade summary","user":{"login":"payten","id":608337,"avatar_url":"https://avatars.githubusercontent.com/u/608337?v=3","gravatar_id":"","url":"https://api.github.com/users/payten","html_url":"https://github.com/payten","followers_url":"https://api.github.com/users/payten/followers","following_url":"https://api.github.com/users/payten/following{/other_user}","gists_url":"https://api.github.com/users/payten/gists{/gist_id}","starred_url":"https://api.github.com/users/payten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payten/subscriptions","organizations_url":"https://api.github.com/users/payten/orgs","repos_url":"https://api.github.com/users/payten/repos","events_url":"https://api.github.com/users/payten/events{/privacy}","received_events_url":"https://api.github.com/users/payten/received_events","type":"User","site_admin":false},"body":"Hi @steveswinsburg, \r\n\r\nThis PR looks to implement the changes in #66.\r\n\r\n~~It's pretty close! There's an issue in the studentGradeSummaryWindow and clicking \"Next Student\" whereby a second window is displayed on top of the previous.  I played around with replacing the content of the window if it was already \"shown\" but I couldn't get that working :confused:  Any ideas?~~ Figured this one out. Woo :balloon: \r\n\r\nThere's a few things I haven't got to, namely:\r\n- change in opacity of the modal mask depending on which tab is being displayed\r\n- show a confirmation dialog when closing the modal when on the student tab\r\nI'm tempted to create separate bugs/issues for those.\r\n- link to the edit comments modal from this window\r\n\r\nThanks!\r\nPayten","created_at":"2015-08-04T04:34:07Z","updated_at":"2015-08-07T00:07:30Z","closed_at":"2015-08-06T11:10:07Z","merged_at":"2015-08-06T11:10:07Z","merge_commit_sha":"94ebc2303627f3fa107e1225f8ab11bf8bf76c7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170/commits","review_comments_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170/comments","review_comment_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/comments{/number}","comments_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/170/comments","statuses_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/statuses/05448c0680018bd0a295c4eeda3af97f6ef3b487","head":{"label":"payten:student-drilldown-stuff","ref":"student-drilldown-stuff","sha":"05448c0680018bd0a295c4eeda3af97f6ef3b487","user":{"login":"payten","id":608337,"avatar_url":"https://avatars.githubusercontent.com/u/608337?v=3","gravatar_id":"","url":"https://api.github.com/users/payten","html_url":"https://github.com/payten","followers_url":"https://api.github.com/users/payten/followers","following_url":"https://api.github.com/users/payten/following{/other_user}","gists_url":"https://api.github.com/users/payten/gists{/gist_id}","starred_url":"https://api.github.com/users/payten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payten/subscriptions","organizations_url":"https://api.github.com/users/payten/orgs","repos_url":"https://api.github.com/users/payten/repos","events_url":"https://api.github.com/users/payten/events{/privacy}","received_events_url":"https://api.github.com/users/payten/received_events","type":"User","site_admin":false},"repo":{"id":28996163,"name":"gradebookNG","full_name":"payten/gradebookNG","owner":{"login":"payten","id":608337,"avatar_url":"https://avatars.githubusercontent.com/u/608337?v=3","gravatar_id":"","url":"https://api.github.com/users/payten","html_url":"https://github.com/payten","followers_url":"https://api.github.com/users/payten/followers","following_url":"https://api.github.com/users/payten/following{/other_user}","gists_url":"https://api.github.com/users/payten/gists{/gist_id}","starred_url":"https://api.github.com/users/payten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/payten/subscriptions","organizations_url":"https://api.github.com/users/payten/orgs","repos_url":"https://api.github.com/users/payten/repos","events_url":"https://api.github.com/users/payten/events{/privacy}","received_events_url":"https://api.github.com/users/payten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/payten/gradebookNG","description":"The Next Generation Gradebook for the Sakai CLE","fork":true,"url":"https://api.github.com/repos/payten/gradebookNG","forks_url":"https://api.github.com/repos/payten/gradebookNG/forks","keys_url":"https://api.github.com/repos/payten/gradebookNG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/payten/gradebookNG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/payten/gradebookNG/teams","hooks_url":"https://api.github.com/repos/payten/gradebookNG/hooks","issue_events_url":"https://api.github.com/repos/payten/gradebookNG/issues/events{/number}","events_url":"https://api.github.com/repos/payten/gradebookNG/events","assignees_url":"https://api.github.com/repos/payten/gradebookNG/assignees{/user}","branches_url":"https://api.github.com/repos/payten/gradebookNG/branches{/branch}","tags_url":"https://api.github.com/repos/payten/gradebookNG/tags","blobs_url":"https://api.github.com/repos/payten/gradebookNG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/payten/gradebookNG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/payten/gradebookNG/git/refs{/sha}","trees_url":"https://api.github.com/repos/payten/gradebookNG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/payten/gradebookNG/statuses/{sha}","languages_url":"https://api.github.com/repos/payten/gradebookNG/languages","stargazers_url":"https://api.github.com/repos/payten/gradebookNG/stargazers","contributors_url":"https://api.github.com/repos/payten/gradebookNG/contributors","subscribers_url":"https://api.github.com/repos/payten/gradebookNG/subscribers","subscription_url":"https://api.github.com/repos/payten/gradebookNG/subscription","commits_url":"https://api.github.com/repos/payten/gradebookNG/commits{/sha}","git_commits_url":"https://api.github.com/repos/payten/gradebookNG/git/commits{/sha}","comments_url":"https://api.github.com/repos/payten/gradebookNG/comments{/number}","issue_comment_url":"https://api.github.com/repos/payten/gradebookNG/issues/comments{/number}","contents_url":"https://api.github.com/repos/payten/gradebookNG/contents/{+path}","compare_url":"https://api.github.com/repos/payten/gradebookNG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/payten/gradebookNG/merges","archive_url":"https://api.github.com/repos/payten/gradebookNG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/payten/gradebookNG/downloads","issues_url":"https://api.github.com/repos/payten/gradebookNG/issues{/number}","pulls_url":"https://api.github.com/repos/payten/gradebookNG/pulls{/number}","milestones_url":"https://api.github.com/repos/payten/gradebookNG/milestones{/number}","notifications_url":"https://api.github.com/repos/payten/gradebookNG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/payten/gradebookNG/labels{/name}","releases_url":"https://api.github.com/repos/payten/gradebookNG/releases{/id}","created_at":"2015-01-09T02:10:26Z","updated_at":"2015-01-09T02:10:26Z","pushed_at":"2015-08-04T08:08:10Z","git_url":"git://github.com/payten/gradebookNG.git","ssh_url":"git@github.com:payten/gradebookNG.git","clone_url":"https://github.com/payten/gradebookNG.git","svn_url":"https://github.com/payten/gradebookNG","homepage":null,"size":2472,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"steveswinsburg:master","ref":"master","sha":"af09f2dc9de8504a5f6328947981685af0505dfb","user":{"login":"steveswinsburg","id":129129,"avatar_url":"https://avatars.githubusercontent.com/u/129129?v=3","gravatar_id":"","url":"https://api.github.com/users/steveswinsburg","html_url":"https://github.com/steveswinsburg","followers_url":"https://api.github.com/users/steveswinsburg/followers","following_url":"https://api.github.com/users/steveswinsburg/following{/other_user}","gists_url":"https://api.github.com/users/steveswinsburg/gists{/gist_id}","starred_url":"https://api.github.com/users/steveswinsburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveswinsburg/subscriptions","organizations_url":"https://api.github.com/users/steveswinsburg/orgs","repos_url":"https://api.github.com/users/steveswinsburg/repos","events_url":"https://api.github.com/users/steveswinsburg/events{/privacy}","received_events_url":"https://api.github.com/users/steveswinsburg/received_events","type":"User","site_admin":false},"repo":{"id":26706381,"name":"gradebookNG","full_name":"steveswinsburg/gradebookNG","owner":{"login":"steveswinsburg","id":129129,"avatar_url":"https://avatars.githubusercontent.com/u/129129?v=3","gravatar_id":"","url":"https://api.github.com/users/steveswinsburg","html_url":"https://github.com/steveswinsburg","followers_url":"https://api.github.com/users/steveswinsburg/followers","following_url":"https://api.github.com/users/steveswinsburg/following{/other_user}","gists_url":"https://api.github.com/users/steveswinsburg/gists{/gist_id}","starred_url":"https://api.github.com/users/steveswinsburg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveswinsburg/subscriptions","organizations_url":"https://api.github.com/users/steveswinsburg/orgs","repos_url":"https://api.github.com/users/steveswinsburg/repos","events_url":"https://api.github.com/users/steveswinsburg/events{/privacy}","received_events_url":"https://api.github.com/users/steveswinsburg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/steveswinsburg/gradebookNG","description":"The Next Generation Gradebook for the Sakai CLE","fork":false,"url":"https://api.github.com/repos/steveswinsburg/gradebookNG","forks_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/forks","keys_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/teams","hooks_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/hooks","issue_events_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/events{/number}","events_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/events","assignees_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/assignees{/user}","branches_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/branches{/branch}","tags_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/tags","blobs_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/git/refs{/sha}","trees_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/statuses/{sha}","languages_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/languages","stargazers_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/stargazers","contributors_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/contributors","subscribers_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/subscribers","subscription_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/subscription","commits_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/commits{/sha}","git_commits_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/git/commits{/sha}","comments_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/comments{/number}","issue_comment_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/comments{/number}","contents_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/contents/{+path}","compare_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/merges","archive_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/downloads","issues_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues{/number}","pulls_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls{/number}","milestones_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/milestones{/number}","notifications_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/labels{/name}","releases_url":"https://api.github.com/repos/steveswinsburg/gradebookNG/releases{/id}","created_at":"2014-11-16T06:45:10Z","updated_at":"2015-06-18T14:01:10Z","pushed_at":"2015-08-06T11:17:36Z","git_url":"git://github.com/steveswinsburg/gradebookNG.git","ssh_url":"git@github.com:steveswinsburg/gradebookNG.git","clone_url":"https://github.com/steveswinsburg/gradebookNG.git","svn_url":"https://github.com/steveswinsburg/gradebookNG","homepage":null,"size":2812,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":32,"forks":2,"open_issues":32,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170"},"html":{"href":"https://github.com/steveswinsburg/gradebookNG/pull/170"},"issue":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/170"},"comments":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/steveswinsburg/gradebookNG/statuses/05448c0680018bd0a295c4eeda3af97f6ef3b487"}}}}