{"action":"created","comment":{"url":"https://api.github.com/repos/openMF/community-app/pulls/comments/53757326","id":53757326,"diff_hunk":"@@ -0,0 +1,77 @@\n+(function (module) {\n+    mifosX.controllers = _.extend(module, {\n+        SurveyController: function (scope, resourceFactory, location, routeParams, localStorageService,$modal) {\n+            \n+            scope.clientId = routeParams.clientId;\n+            scope.formData = {};\n+            scope.surveyData = {};\n+            scope.survey = {};\n+\n+            resourceFactory.surveyResource.get({}, function (data) {\n+                scope.surveys = data;\n+            });\n+\n+            scope.surveySelected = function (surveyData) {\n+                if(surveyData) {\n+                    scope.surveyData = surveyData;\n+\n+                    function groupBy( array , f )\n+                    {\n+                      var groups = {};\n+                      array.forEach( function( o )\n+                      {\n+                        var group = JSON.stringify( f(o) );\n+                        groups[group] = groups[group] || [];\n+                        groups[group].push( o );  \n+                      });\n+                      return Object.keys(groups).map( function( group )\n+                      {\n+                        return groups[group]; \n+                      })\n+                    }\n+                    \n+                    var result = groupBy(scope.surveyData.questionDatas, function(item)\n+                    {\n+                      return [item.componentKey];\n+                    });\n+\n+                    scope.componentGroups = result;\n+                }\n+                \n+            }\n+\n+            scope.submit = function () {\n+                this.formData.userId = localStorageService.getFromLocalStorage('userData').userId;\n+                this.formData.clientId = routeParams.clientId;\n+                this.formData.createdOn = new Date().getTime();\n+                this.formData.scorecardValues = [];\n+\n+                for(i=0; i < scope.surveyData.questionDatas.length; i++){\n+                    if(scope.surveyData.questionDatas[i].answer) {\n+                        var tmp = {};\n+                        tmp.questionId = scope.surveyData.questionDatas[i].id;\n+                        tmp.responseId = scope.surveyData.questionDatas[i].answer.id\n+                        tmp.value = scope.surveyData.questionDatas[i].answer.value\n+                        this.formData.scorecardValues.push(tmp);\n+                    }\n+                }\n+                console.log(this.formData);","path":"app/scripts/controllers/client/SurveyController.js","position":58,"original_position":58,"commit_id":"f473af6fcd809211fd0149c673210f9aab89c689","original_commit_id":"f473af6fcd809211fd0149c673210f9aab89c689","user":{"login":"nazeer1100126","id":13728454,"avatar_url":"https://avatars.githubusercontent.com/u/13728454?v=3","gravatar_id":"","url":"https://api.github.com/users/nazeer1100126","html_url":"https://github.com/nazeer1100126","followers_url":"https://api.github.com/users/nazeer1100126/followers","following_url":"https://api.github.com/users/nazeer1100126/following{/other_user}","gists_url":"https://api.github.com/users/nazeer1100126/gists{/gist_id}","starred_url":"https://api.github.com/users/nazeer1100126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazeer1100126/subscriptions","organizations_url":"https://api.github.com/users/nazeer1100126/orgs","repos_url":"https://api.github.com/users/nazeer1100126/repos","events_url":"https://api.github.com/users/nazeer1100126/events{/privacy}","received_events_url":"https://api.github.com/users/nazeer1100126/received_events","type":"User","site_admin":false},"body":"Remove console log","created_at":"2016-02-23T09:52:31Z","updated_at":"2016-02-23T09:52:31Z","html_url":"https://github.com/openMF/community-app/pull/1470#discussion_r53757326","pull_request_url":"https://api.github.com/repos/openMF/community-app/pulls/1470","_links":{"self":{"href":"https://api.github.com/repos/openMF/community-app/pulls/comments/53757326"},"html":{"href":"https://github.com/openMF/community-app/pull/1470#discussion_r53757326"},"pull_request":{"href":"https://api.github.com/repos/openMF/community-app/pulls/1470"}}},"pull_request":{"url":"https://api.github.com/repos/openMF/community-app/pulls/1470","id":56857952,"html_url":"https://github.com/openMF/community-app/pull/1470","diff_url":"https://github.com/openMF/community-app/pull/1470.diff","patch_url":"https://github.com/openMF/community-app/pull/1470.patch","issue_url":"https://api.github.com/repos/openMF/community-app/issues/1470","number":1470,"state":"open","locked":false,"title":"Survey","user":{"login":"gauravsaini03","id":1821959,"avatar_url":"https://avatars.githubusercontent.com/u/1821959?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravsaini03","html_url":"https://github.com/gauravsaini03","followers_url":"https://api.github.com/users/gauravsaini03/followers","following_url":"https://api.github.com/users/gauravsaini03/following{/other_user}","gists_url":"https://api.github.com/users/gauravsaini03/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravsaini03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravsaini03/subscriptions","organizations_url":"https://api.github.com/users/gauravsaini03/orgs","repos_url":"https://api.github.com/users/gauravsaini03/repos","events_url":"https://api.github.com/users/gauravsaini03/events{/privacy}","received_events_url":"https://api.github.com/users/gauravsaini03/received_events","type":"User","site_admin":false},"body":"Implemented Survey in community-app","created_at":"2016-01-22T08:12:40Z","updated_at":"2016-02-23T09:52:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b9a57e3fc6cb84a45059c70841e2f99bebfc946","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openMF/community-app/pulls/1470/commits","review_comments_url":"https://api.github.com/repos/openMF/community-app/pulls/1470/comments","review_comment_url":"https://api.github.com/repos/openMF/community-app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openMF/community-app/issues/1470/comments","statuses_url":"https://api.github.com/repos/openMF/community-app/statuses/f473af6fcd809211fd0149c673210f9aab89c689","head":{"label":"gauravsaini03:survey","ref":"survey","sha":"f473af6fcd809211fd0149c673210f9aab89c689","user":{"login":"gauravsaini03","id":1821959,"avatar_url":"https://avatars.githubusercontent.com/u/1821959?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravsaini03","html_url":"https://github.com/gauravsaini03","followers_url":"https://api.github.com/users/gauravsaini03/followers","following_url":"https://api.github.com/users/gauravsaini03/following{/other_user}","gists_url":"https://api.github.com/users/gauravsaini03/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravsaini03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravsaini03/subscriptions","organizations_url":"https://api.github.com/users/gauravsaini03/orgs","repos_url":"https://api.github.com/users/gauravsaini03/repos","events_url":"https://api.github.com/users/gauravsaini03/events{/privacy}","received_events_url":"https://api.github.com/users/gauravsaini03/received_events","type":"User","site_admin":false},"repo":{"id":17143419,"name":"community-app","full_name":"gauravsaini03/community-app","owner":{"login":"gauravsaini03","id":1821959,"avatar_url":"https://avatars.githubusercontent.com/u/1821959?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravsaini03","html_url":"https://github.com/gauravsaini03","followers_url":"https://api.github.com/users/gauravsaini03/followers","following_url":"https://api.github.com/users/gauravsaini03/following{/other_user}","gists_url":"https://api.github.com/users/gauravsaini03/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravsaini03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravsaini03/subscriptions","organizations_url":"https://api.github.com/users/gauravsaini03/orgs","repos_url":"https://api.github.com/users/gauravsaini03/repos","events_url":"https://api.github.com/users/gauravsaini03/events{/privacy}","received_events_url":"https://api.github.com/users/gauravsaini03/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gauravsaini03/community-app","description":"This is the default web application built on top of the MifosX platform for the mifos user community. It is a Single-Page App (SPA) written in web standard technologies like JavaScript, CSS and HTML5. It leverages common popular frameworks/libraries such as AngularJS, Bootstrap and Font Awesome","fork":true,"url":"https://api.github.com/repos/gauravsaini03/community-app","forks_url":"https://api.github.com/repos/gauravsaini03/community-app/forks","keys_url":"https://api.github.com/repos/gauravsaini03/community-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gauravsaini03/community-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gauravsaini03/community-app/teams","hooks_url":"https://api.github.com/repos/gauravsaini03/community-app/hooks","issue_events_url":"https://api.github.com/repos/gauravsaini03/community-app/issues/events{/number}","events_url":"https://api.github.com/repos/gauravsaini03/community-app/events","assignees_url":"https://api.github.com/repos/gauravsaini03/community-app/assignees{/user}","branches_url":"https://api.github.com/repos/gauravsaini03/community-app/branches{/branch}","tags_url":"https://api.github.com/repos/gauravsaini03/community-app/tags","blobs_url":"https://api.github.com/repos/gauravsaini03/community-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gauravsaini03/community-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gauravsaini03/community-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/gauravsaini03/community-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gauravsaini03/community-app/statuses/{sha}","languages_url":"https://api.github.com/repos/gauravsaini03/community-app/languages","stargazers_url":"https://api.github.com/repos/gauravsaini03/community-app/stargazers","contributors_url":"https://api.github.com/repos/gauravsaini03/community-app/contributors","subscribers_url":"https://api.github.com/repos/gauravsaini03/community-app/subscribers","subscription_url":"https://api.github.com/repos/gauravsaini03/community-app/subscription","commits_url":"https://api.github.com/repos/gauravsaini03/community-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/gauravsaini03/community-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/gauravsaini03/community-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/gauravsaini03/community-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/gauravsaini03/community-app/contents/{+path}","compare_url":"https://api.github.com/repos/gauravsaini03/community-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gauravsaini03/community-app/merges","archive_url":"https://api.github.com/repos/gauravsaini03/community-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gauravsaini03/community-app/downloads","issues_url":"https://api.github.com/repos/gauravsaini03/community-app/issues{/number}","pulls_url":"https://api.github.com/repos/gauravsaini03/community-app/pulls{/number}","milestones_url":"https://api.github.com/repos/gauravsaini03/community-app/milestones{/number}","notifications_url":"https://api.github.com/repos/gauravsaini03/community-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gauravsaini03/community-app/labels{/name}","releases_url":"https://api.github.com/repos/gauravsaini03/community-app/releases{/id}","deployments_url":"https://api.github.com/repos/gauravsaini03/community-app/deployments","created_at":"2014-02-24T16:59:27Z","updated_at":"2015-03-10T12:53:40Z","pushed_at":"2016-01-22T06:47:55Z","git_url":"git://github.com/gauravsaini03/community-app.git","ssh_url":"git@github.com:gauravsaini03/community-app.git","clone_url":"https://github.com/gauravsaini03/community-app.git","svn_url":"https://github.com/gauravsaini03/community-app","homepage":"http://openmf.github.io/community-app/","size":38077,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"openMF:develop","ref":"develop","sha":"942cd92a944424c9955b601707415fcab1f7b07a","user":{"login":"openMF","id":3473607,"avatar_url":"https://avatars.githubusercontent.com/u/3473607?v=3","gravatar_id":"","url":"https://api.github.com/users/openMF","html_url":"https://github.com/openMF","followers_url":"https://api.github.com/users/openMF/followers","following_url":"https://api.github.com/users/openMF/following{/other_user}","gists_url":"https://api.github.com/users/openMF/gists{/gist_id}","starred_url":"https://api.github.com/users/openMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openMF/subscriptions","organizations_url":"https://api.github.com/users/openMF/orgs","repos_url":"https://api.github.com/users/openMF/repos","events_url":"https://api.github.com/users/openMF/events{/privacy}","received_events_url":"https://api.github.com/users/openMF/received_events","type":"Organization","site_admin":false},"repo":{"id":10191885,"name":"community-app","full_name":"openMF/community-app","owner":{"login":"openMF","id":3473607,"avatar_url":"https://avatars.githubusercontent.com/u/3473607?v=3","gravatar_id":"","url":"https://api.github.com/users/openMF","html_url":"https://github.com/openMF","followers_url":"https://api.github.com/users/openMF/followers","following_url":"https://api.github.com/users/openMF/following{/other_user}","gists_url":"https://api.github.com/users/openMF/gists{/gist_id}","starred_url":"https://api.github.com/users/openMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openMF/subscriptions","organizations_url":"https://api.github.com/users/openMF/orgs","repos_url":"https://api.github.com/users/openMF/repos","events_url":"https://api.github.com/users/openMF/events{/privacy}","received_events_url":"https://api.github.com/users/openMF/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openMF/community-app","description":"This is the default web application built on top of the MifosX platform for the mifos user community. It is a Single-Page App (SPA) written in web standard technologies like JavaScript, CSS and HTML5. It leverages common popular frameworks/libraries such as AngularJS, Bootstrap and Font Awesome","fork":false,"url":"https://api.github.com/repos/openMF/community-app","forks_url":"https://api.github.com/repos/openMF/community-app/forks","keys_url":"https://api.github.com/repos/openMF/community-app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openMF/community-app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openMF/community-app/teams","hooks_url":"https://api.github.com/repos/openMF/community-app/hooks","issue_events_url":"https://api.github.com/repos/openMF/community-app/issues/events{/number}","events_url":"https://api.github.com/repos/openMF/community-app/events","assignees_url":"https://api.github.com/repos/openMF/community-app/assignees{/user}","branches_url":"https://api.github.com/repos/openMF/community-app/branches{/branch}","tags_url":"https://api.github.com/repos/openMF/community-app/tags","blobs_url":"https://api.github.com/repos/openMF/community-app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openMF/community-app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openMF/community-app/git/refs{/sha}","trees_url":"https://api.github.com/repos/openMF/community-app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openMF/community-app/statuses/{sha}","languages_url":"https://api.github.com/repos/openMF/community-app/languages","stargazers_url":"https://api.github.com/repos/openMF/community-app/stargazers","contributors_url":"https://api.github.com/repos/openMF/community-app/contributors","subscribers_url":"https://api.github.com/repos/openMF/community-app/subscribers","subscription_url":"https://api.github.com/repos/openMF/community-app/subscription","commits_url":"https://api.github.com/repos/openMF/community-app/commits{/sha}","git_commits_url":"https://api.github.com/repos/openMF/community-app/git/commits{/sha}","comments_url":"https://api.github.com/repos/openMF/community-app/comments{/number}","issue_comment_url":"https://api.github.com/repos/openMF/community-app/issues/comments{/number}","contents_url":"https://api.github.com/repos/openMF/community-app/contents/{+path}","compare_url":"https://api.github.com/repos/openMF/community-app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openMF/community-app/merges","archive_url":"https://api.github.com/repos/openMF/community-app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openMF/community-app/downloads","issues_url":"https://api.github.com/repos/openMF/community-app/issues{/number}","pulls_url":"https://api.github.com/repos/openMF/community-app/pulls{/number}","milestones_url":"https://api.github.com/repos/openMF/community-app/milestones{/number}","notifications_url":"https://api.github.com/repos/openMF/community-app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openMF/community-app/labels{/name}","releases_url":"https://api.github.com/repos/openMF/community-app/releases{/id}","deployments_url":"https://api.github.com/repos/openMF/community-app/deployments","created_at":"2013-05-21T09:09:38Z","updated_at":"2016-02-12T03:43:33Z","pushed_at":"2016-02-23T09:40:57Z","git_url":"git://github.com/openMF/community-app.git","ssh_url":"git@github.com:openMF/community-app.git","clone_url":"https://github.com/openMF/community-app.git","svn_url":"https://github.com/openMF/community-app","homepage":"http://openmf.github.io/community-app/","size":38906,"stargazers_count":53,"watchers_count":53,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":352,"mirror_url":null,"open_issues_count":70,"forks":352,"open_issues":70,"watchers":53,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openMF/community-app/pulls/1470"},"html":{"href":"https://github.com/openMF/community-app/pull/1470"},"issue":{"href":"https://api.github.com/repos/openMF/community-app/issues/1470"},"comments":{"href":"https://api.github.com/repos/openMF/community-app/issues/1470/comments"},"review_comments":{"href":"https://api.github.com/repos/openMF/community-app/pulls/1470/comments"},"review_comment":{"href":"https://api.github.com/repos/openMF/community-app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openMF/community-app/pulls/1470/commits"},"statuses":{"href":"https://api.github.com/repos/openMF/community-app/statuses/f473af6fcd809211fd0149c673210f9aab89c689"}}}}