{"action":"created","comment":{"url":"https://api.github.com/repos/singpath/classmentors/pulls/comments/79316774","id":79316774,"diff_hunk":"@@ -1036,31 +925,113 @@ function ClmCohortRankPageCtrl($q, $scope, $log, firebaseApp, $firebaseObject, $\n                         oneEventData.title = result.title;\n                         self.cohortTotalParticipants += oneEventData.participants.length;\n                         oneEventData.id = result.$id;\n-                        self.cohortEventData.push(oneEventData);\n-                        iter++;\n-                        loopDBEvents();\n+                        oneEventData.userRanks = [];\n+                        var userIndex = 0;\n+                        loadUserAchievements();\n+                        function loadUserAchievements() {\n+                            if(userIndex < oneEventData.participants.length) {\n+                                var participantRankingRef = db.ref(`classMentors/userProfiles/${oneEventData.participants[userIndex].$id}`);\n+                                var participantRankingObj = $firebaseObject(participantRankingRef);\n+                                participantRankingObj.$loaded().then(function () {\n+                                    var rankingResult = participantRankingObj;\n+                                    console.log(rankingResult);\n+                                    if(rankingResult.services && rankingResult.services.freeCodeCamp) {\n+                                        oneEventData.userRanks.push({\"user\": rankingResult.user, \"total\": parseInt(rankingResult.services.freeCodeCamp.totalAchievements)});\n+                                    } else {\n+                                        oneEventData.userRanks.push({\"user\": rankingResult.user, \"total\": 0});\n+                                    }\n+                                    userIndex++;\n+                                    loadUserAchievements();","path":"src/classmentors/components/cohorts/cohorts.js","position":237,"original_position":237,"commit_id":"df34b1cfe99d7d5c912987dcab427e1f1fde80ea","original_commit_id":"df34b1cfe99d7d5c912987dcab427e1f1fde80ea","user":{"login":"dinoboff","id":6830,"avatar_url":"https://avatars.githubusercontent.com/u/6830?v=3","gravatar_id":"","url":"https://api.github.com/users/dinoboff","html_url":"https://github.com/dinoboff","followers_url":"https://api.github.com/users/dinoboff/followers","following_url":"https://api.github.com/users/dinoboff/following{/other_user}","gists_url":"https://api.github.com/users/dinoboff/gists{/gist_id}","starred_url":"https://api.github.com/users/dinoboff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinoboff/subscriptions","organizations_url":"https://api.github.com/users/dinoboff/orgs","repos_url":"https://api.github.com/users/dinoboff/repos","events_url":"https://api.github.com/users/dinoboff/events{/privacy}","received_events_url":"https://api.github.com/users/dinoboff/received_events","type":"User","site_admin":false},"body":"Any reason why you use recursive calls instead of Array methods or simple loops?","created_at":"2016-09-18T22:42:31Z","updated_at":"2016-09-18T22:42:31Z","html_url":"https://github.com/singpath/classmentors/pull/109#discussion_r79316774","pull_request_url":"https://api.github.com/repos/singpath/classmentors/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/comments/79316774"},"html":{"href":"https://github.com/singpath/classmentors/pull/109#discussion_r79316774"},"pull_request":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/singpath/classmentors/pulls/109","id":85715488,"html_url":"https://github.com/singpath/classmentors/pull/109","diff_url":"https://github.com/singpath/classmentors/pull/109.diff","patch_url":"https://github.com/singpath/classmentors/pull/109.patch","issue_url":"https://api.github.com/repos/singpath/classmentors/issues/109","number":109,"state":"open","locked":false,"title":"Cohort filtered ranking","user":{"login":"shiquan-lim","id":19287054,"avatar_url":"https://avatars.githubusercontent.com/u/19287054?v=3","gravatar_id":"","url":"https://api.github.com/users/shiquan-lim","html_url":"https://github.com/shiquan-lim","followers_url":"https://api.github.com/users/shiquan-lim/followers","following_url":"https://api.github.com/users/shiquan-lim/following{/other_user}","gists_url":"https://api.github.com/users/shiquan-lim/gists{/gist_id}","starred_url":"https://api.github.com/users/shiquan-lim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiquan-lim/subscriptions","organizations_url":"https://api.github.com/users/shiquan-lim/orgs","repos_url":"https://api.github.com/users/shiquan-lim/repos","events_url":"https://api.github.com/users/shiquan-lim/events{/privacy}","received_events_url":"https://api.github.com/users/shiquan-lim/received_events","type":"User","site_admin":false},"body":"Implemented Cohort filtered ranking and sorted out most conflicts between the 3.0 update and the team's code.\r\n\r\nTeam activities are not included in this update","created_at":"2016-09-18T16:42:20Z","updated_at":"2016-09-18T22:56:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c77c88c47b0ea337554e34160e8066f577e13f1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/singpath/classmentors/pulls/109/commits","review_comments_url":"https://api.github.com/repos/singpath/classmentors/pulls/109/comments","review_comment_url":"https://api.github.com/repos/singpath/classmentors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/singpath/classmentors/issues/109/comments","statuses_url":"https://api.github.com/repos/singpath/classmentors/statuses/df34b1cfe99d7d5c912987dcab427e1f1fde80ea","head":{"label":"shiquan-lim:3.0-holding-master","ref":"3.0-holding-master","sha":"df34b1cfe99d7d5c912987dcab427e1f1fde80ea","user":{"login":"shiquan-lim","id":19287054,"avatar_url":"https://avatars.githubusercontent.com/u/19287054?v=3","gravatar_id":"","url":"https://api.github.com/users/shiquan-lim","html_url":"https://github.com/shiquan-lim","followers_url":"https://api.github.com/users/shiquan-lim/followers","following_url":"https://api.github.com/users/shiquan-lim/following{/other_user}","gists_url":"https://api.github.com/users/shiquan-lim/gists{/gist_id}","starred_url":"https://api.github.com/users/shiquan-lim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiquan-lim/subscriptions","organizations_url":"https://api.github.com/users/shiquan-lim/orgs","repos_url":"https://api.github.com/users/shiquan-lim/repos","events_url":"https://api.github.com/users/shiquan-lim/events{/privacy}","received_events_url":"https://api.github.com/users/shiquan-lim/received_events","type":"User","site_admin":false},"repo":{"id":58467135,"name":"classmentors","full_name":"shiquan-lim/classmentors","owner":{"login":"shiquan-lim","id":19287054,"avatar_url":"https://avatars.githubusercontent.com/u/19287054?v=3","gravatar_id":"","url":"https://api.github.com/users/shiquan-lim","html_url":"https://github.com/shiquan-lim","followers_url":"https://api.github.com/users/shiquan-lim/followers","following_url":"https://api.github.com/users/shiquan-lim/following{/other_user}","gists_url":"https://api.github.com/users/shiquan-lim/gists{/gist_id}","starred_url":"https://api.github.com/users/shiquan-lim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiquan-lim/subscriptions","organizations_url":"https://api.github.com/users/shiquan-lim/orgs","repos_url":"https://api.github.com/users/shiquan-lim/repos","events_url":"https://api.github.com/users/shiquan-lim/events{/privacy}","received_events_url":"https://api.github.com/users/shiquan-lim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shiquan-lim/classmentors","description":"Class Mentors UI","fork":true,"url":"https://api.github.com/repos/shiquan-lim/classmentors","forks_url":"https://api.github.com/repos/shiquan-lim/classmentors/forks","keys_url":"https://api.github.com/repos/shiquan-lim/classmentors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shiquan-lim/classmentors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shiquan-lim/classmentors/teams","hooks_url":"https://api.github.com/repos/shiquan-lim/classmentors/hooks","issue_events_url":"https://api.github.com/repos/shiquan-lim/classmentors/issues/events{/number}","events_url":"https://api.github.com/repos/shiquan-lim/classmentors/events","assignees_url":"https://api.github.com/repos/shiquan-lim/classmentors/assignees{/user}","branches_url":"https://api.github.com/repos/shiquan-lim/classmentors/branches{/branch}","tags_url":"https://api.github.com/repos/shiquan-lim/classmentors/tags","blobs_url":"https://api.github.com/repos/shiquan-lim/classmentors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shiquan-lim/classmentors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shiquan-lim/classmentors/git/refs{/sha}","trees_url":"https://api.github.com/repos/shiquan-lim/classmentors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shiquan-lim/classmentors/statuses/{sha}","languages_url":"https://api.github.com/repos/shiquan-lim/classmentors/languages","stargazers_url":"https://api.github.com/repos/shiquan-lim/classmentors/stargazers","contributors_url":"https://api.github.com/repos/shiquan-lim/classmentors/contributors","subscribers_url":"https://api.github.com/repos/shiquan-lim/classmentors/subscribers","subscription_url":"https://api.github.com/repos/shiquan-lim/classmentors/subscription","commits_url":"https://api.github.com/repos/shiquan-lim/classmentors/commits{/sha}","git_commits_url":"https://api.github.com/repos/shiquan-lim/classmentors/git/commits{/sha}","comments_url":"https://api.github.com/repos/shiquan-lim/classmentors/comments{/number}","issue_comment_url":"https://api.github.com/repos/shiquan-lim/classmentors/issues/comments{/number}","contents_url":"https://api.github.com/repos/shiquan-lim/classmentors/contents/{+path}","compare_url":"https://api.github.com/repos/shiquan-lim/classmentors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shiquan-lim/classmentors/merges","archive_url":"https://api.github.com/repos/shiquan-lim/classmentors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shiquan-lim/classmentors/downloads","issues_url":"https://api.github.com/repos/shiquan-lim/classmentors/issues{/number}","pulls_url":"https://api.github.com/repos/shiquan-lim/classmentors/pulls{/number}","milestones_url":"https://api.github.com/repos/shiquan-lim/classmentors/milestones{/number}","notifications_url":"https://api.github.com/repos/shiquan-lim/classmentors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shiquan-lim/classmentors/labels{/name}","releases_url":"https://api.github.com/repos/shiquan-lim/classmentors/releases{/id}","deployments_url":"https://api.github.com/repos/shiquan-lim/classmentors/deployments","created_at":"2016-05-10T14:14:36Z","updated_at":"2016-06-30T17:25:26Z","pushed_at":"2016-09-18T17:39:39Z","git_url":"git://github.com/shiquan-lim/classmentors.git","ssh_url":"git@github.com:shiquan-lim/classmentors.git","clone_url":"https://github.com/shiquan-lim/classmentors.git","svn_url":"https://github.com/shiquan-lim/classmentors","homepage":"http://www.classmentors.com","size":10396,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":40,"forks":1,"open_issues":40,"watchers":1,"default_branch":"master"}},"base":{"label":"singpath:master","ref":"master","sha":"2248bec51d71b3086bc669d501ee0fc4d2c4b1ad","user":{"login":"singpath","id":15899764,"avatar_url":"https://avatars.githubusercontent.com/u/15899764?v=3","gravatar_id":"","url":"https://api.github.com/users/singpath","html_url":"https://github.com/singpath","followers_url":"https://api.github.com/users/singpath/followers","following_url":"https://api.github.com/users/singpath/following{/other_user}","gists_url":"https://api.github.com/users/singpath/gists{/gist_id}","starred_url":"https://api.github.com/users/singpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singpath/subscriptions","organizations_url":"https://api.github.com/users/singpath/orgs","repos_url":"https://api.github.com/users/singpath/repos","events_url":"https://api.github.com/users/singpath/events{/privacy}","received_events_url":"https://api.github.com/users/singpath/received_events","type":"Organization","site_admin":false},"repo":{"id":53763096,"name":"classmentors","full_name":"singpath/classmentors","owner":{"login":"singpath","id":15899764,"avatar_url":"https://avatars.githubusercontent.com/u/15899764?v=3","gravatar_id":"","url":"https://api.github.com/users/singpath","html_url":"https://github.com/singpath","followers_url":"https://api.github.com/users/singpath/followers","following_url":"https://api.github.com/users/singpath/following{/other_user}","gists_url":"https://api.github.com/users/singpath/gists{/gist_id}","starred_url":"https://api.github.com/users/singpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/singpath/subscriptions","organizations_url":"https://api.github.com/users/singpath/orgs","repos_url":"https://api.github.com/users/singpath/repos","events_url":"https://api.github.com/users/singpath/events{/privacy}","received_events_url":"https://api.github.com/users/singpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/singpath/classmentors","description":"Class Mentors UI","fork":false,"url":"https://api.github.com/repos/singpath/classmentors","forks_url":"https://api.github.com/repos/singpath/classmentors/forks","keys_url":"https://api.github.com/repos/singpath/classmentors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/singpath/classmentors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/singpath/classmentors/teams","hooks_url":"https://api.github.com/repos/singpath/classmentors/hooks","issue_events_url":"https://api.github.com/repos/singpath/classmentors/issues/events{/number}","events_url":"https://api.github.com/repos/singpath/classmentors/events","assignees_url":"https://api.github.com/repos/singpath/classmentors/assignees{/user}","branches_url":"https://api.github.com/repos/singpath/classmentors/branches{/branch}","tags_url":"https://api.github.com/repos/singpath/classmentors/tags","blobs_url":"https://api.github.com/repos/singpath/classmentors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/singpath/classmentors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/singpath/classmentors/git/refs{/sha}","trees_url":"https://api.github.com/repos/singpath/classmentors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/singpath/classmentors/statuses/{sha}","languages_url":"https://api.github.com/repos/singpath/classmentors/languages","stargazers_url":"https://api.github.com/repos/singpath/classmentors/stargazers","contributors_url":"https://api.github.com/repos/singpath/classmentors/contributors","subscribers_url":"https://api.github.com/repos/singpath/classmentors/subscribers","subscription_url":"https://api.github.com/repos/singpath/classmentors/subscription","commits_url":"https://api.github.com/repos/singpath/classmentors/commits{/sha}","git_commits_url":"https://api.github.com/repos/singpath/classmentors/git/commits{/sha}","comments_url":"https://api.github.com/repos/singpath/classmentors/comments{/number}","issue_comment_url":"https://api.github.com/repos/singpath/classmentors/issues/comments{/number}","contents_url":"https://api.github.com/repos/singpath/classmentors/contents/{+path}","compare_url":"https://api.github.com/repos/singpath/classmentors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/singpath/classmentors/merges","archive_url":"https://api.github.com/repos/singpath/classmentors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/singpath/classmentors/downloads","issues_url":"https://api.github.com/repos/singpath/classmentors/issues{/number}","pulls_url":"https://api.github.com/repos/singpath/classmentors/pulls{/number}","milestones_url":"https://api.github.com/repos/singpath/classmentors/milestones{/number}","notifications_url":"https://api.github.com/repos/singpath/classmentors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/singpath/classmentors/labels{/name}","releases_url":"https://api.github.com/repos/singpath/classmentors/releases{/id}","deployments_url":"https://api.github.com/repos/singpath/classmentors/deployments","created_at":"2016-03-13T02:08:02Z","updated_at":"2016-03-15T17:13:27Z","pushed_at":"2016-09-18T16:42:21Z","git_url":"git://github.com/singpath/classmentors.git","ssh_url":"git@github.com:singpath/classmentors.git","clone_url":"https://github.com/singpath/classmentors.git","svn_url":"https://github.com/singpath/classmentors","homepage":"http://www.classmentors.com","size":12425,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":13,"forks":9,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/109"},"html":{"href":"https://github.com/singpath/classmentors/pull/109"},"issue":{"href":"https://api.github.com/repos/singpath/classmentors/issues/109"},"comments":{"href":"https://api.github.com/repos/singpath/classmentors/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/singpath/classmentors/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/singpath/classmentors/statuses/df34b1cfe99d7d5c912987dcab427e1f1fde80ea"}}}}
{"actor":{"display_login":"dinoboff"}}