GitHub PullRequestReviewCommentEvent at 2014-08-19 03:06:31
Repository: trainify
Actor: dariusriggins
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/sosickstudios/trainify/pulls/comments/16394952","id":16394952,"diff_hunk":"@@ -154,15 +158,50 @@\n      * @param {Element.<li>} content The list item element that represents the question.\n      * @param {Number} number The number that this question is on the exercise.\n      */\n-    Exercise.prototype.addQuestion = function (content, number){\n+    Exercise.prototype.addQuestion = function(content, number){\n         var question = new Question(content, this);\n         this.questions.push(question);\n     };\n \n-    Exercise.prototype.questionCount = function (){\n+    Exercise.prototype.questionCount = function(){\n         return this.questions.length;\n     };\n \n+    /**\n+     * Check to see if all questions in the exercise are answered. If all \n+     * questions are answered, an update request to the exercise model should \n+     * be sent to score the exercise.\n+     *\n+     */\n+    Exercise.prototype.onQuestionAnswered = function(){\n+        var emptyQuestion = false;\n+\n+        for(var i = 0; i < this.questions.length; i++){\n+            if(!this.questions[i].isAnswered()) {\n+                emptyQuestion = true;\n+            }\n+        }\n+\n+        if (!emptyQuestion){\n+            // Send an update request to score the exercise;\n+            this.sendUpdateRequest();\n+        }\n+    };\n+\n+    Exercise.prototype.sendUpdateRequest = function(){\n+        var request = new XMLHttpRequest();\n+\n+        request.onreadystatechange = function () {\n+            if(request.readyState === 4 && request.status === 200){\n+                // Set the exercise to be in review mode.\n+            }\n+        }.bind(this);\n+\n+        request.open('PUT', '/exercise', true);","path":"app/scripts/exercise.js","position":93,"original_position":93,"commit_id":"3570a11107d6adce7d208c3844b0b9cb2b0c7d72","original_commit_id":"3570a11107d6adce7d208c3844b0b9cb2b0c7d72","user":{"login":"dariusriggins","id":770432,"avatar_url":"https://avatars.githubusercontent.com/u/770432?v=2","gravatar_id":"323c599a3d0bf927d31ae60649371a64","url":"https://api.github.com/users/dariusriggins","html_url":"https://github.com/dariusriggins","followers_url":"https://api.github.com/users/dariusriggins/followers","following_url":"https://api.github.com/users/dariusriggins/following{/other_user}","gists_url":"https://api.github.com/users/dariusriggins/gists{/gist_id}","starred_url":"https://api.github.com/users/dariusriggins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dariusriggins/subscriptions","organizations_url":"https://api.github.com/users/dariusriggins/orgs","repos_url":"https://api.github.com/users/dariusriggins/repos","events_url":"https://api.github.com/users/dariusriggins/events{/privacy}","received_events_url":"https://api.github.com/users/dariusriggins/received_events","type":"User","site_admin":false},"body":"Same about comment above.","created_at":"2014-08-19T03:06:31Z","updated_at":"2014-08-19T03:06:31Z","html_url":"https://github.com/sosickstudios/trainify/pull/18#discussion_r16394952","pull_request_url":"https://api.github.com/repos/sosickstudios/trainify/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/comments/16394952"},"html":{"href":"https://github.com/sosickstudios/trainify/pull/18#discussion_r16394952"},"pull_request":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/sosickstudios/trainify/pulls/18","id":19900334,"html_url":"https://github.com/sosickstudios/trainify/pull/18","diff_url":"https://github.com/sosickstudios/trainify/pull/18.diff","patch_url":"https://github.com/sosickstudios/trainify/pull/18.patch","issue_url":"https://api.github.com/repos/sosickstudios/trainify/issues/18","number":18,"state":"open","locked":false,"title":"Exercise scoring","user":{"login":"popasquat89","id":1410957,"avatar_url":"https://avatars.githubusercontent.com/u/1410957?v=2","gravatar_id":"f796bb0f23feab90489bc35661edd4bc","url":"https://api.github.com/users/popasquat89","html_url":"https://github.com/popasquat89","followers_url":"https://api.github.com/users/popasquat89/followers","following_url":"https://api.github.com/users/popasquat89/following{/other_user}","gists_url":"https://api.github.com/users/popasquat89/gists{/gist_id}","starred_url":"https://api.github.com/users/popasquat89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/popasquat89/subscriptions","organizations_url":"https://api.github.com/users/popasquat89/orgs","repos_url":"https://api.github.com/users/popasquat89/repos","events_url":"https://api.github.com/users/popasquat89/events{/privacy}","received_events_url":"https://api.github.com/users/popasquat89/received_events","type":"User","site_admin":false},"body":"Add ability for the exercise to be scored after all questions have been answered. ","created_at":"2014-08-18T05:49:32Z","updated_at":"2014-08-19T03:06:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"801e415f125bc01f906ac2567cf19f6ddc373594","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sosickstudios/trainify/pulls/18/commits","review_comments_url":"https://api.github.com/repos/sosickstudios/trainify/pulls/18/comments","review_comment_url":"https://api.github.com/repos/sosickstudios/trainify/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sosickstudios/trainify/issues/18/comments","statuses_url":"https://api.github.com/repos/sosickstudios/trainify/statuses/3570a11107d6adce7d208c3844b0b9cb2b0c7d72","head":{"label":"sosickstudios:exercise-score","ref":"exercise-score","sha":"3570a11107d6adce7d208c3844b0b9cb2b0c7d72","user":{"login":"sosickstudios","id":8128963,"avatar_url":"https://avatars.githubusercontent.com/u/8128963?v=2","gravatar_id":null,"url":"https://api.github.com/users/sosickstudios","html_url":"https://github.com/sosickstudios","followers_url":"https://api.github.com/users/sosickstudios/followers","following_url":"https://api.github.com/users/sosickstudios/following{/other_user}","gists_url":"https://api.github.com/users/sosickstudios/gists{/gist_id}","starred_url":"https://api.github.com/users/sosickstudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sosickstudios/subscriptions","organizations_url":"https://api.github.com/users/sosickstudios/orgs","repos_url":"https://api.github.com/users/sosickstudios/repos","events_url":"https://api.github.com/users/sosickstudios/events{/privacy}","received_events_url":"https://api.github.com/users/sosickstudios/received_events","type":"Organization","site_admin":false},"repo":{"id":21710538,"name":"trainify","full_name":"sosickstudios/trainify","owner":{"login":"sosickstudios","id":8128963,"avatar_url":"https://avatars.githubusercontent.com/u/8128963?v=2","gravatar_id":null,"url":"https://api.github.com/users/sosickstudios","html_url":"https://github.com/sosickstudios","followers_url":"https://api.github.com/users/sosickstudios/followers","following_url":"https://api.github.com/users/sosickstudios/following{/other_user}","gists_url":"https://api.github.com/users/sosickstudios/gists{/gist_id}","starred_url":"https://api.github.com/users/sosickstudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sosickstudios/subscriptions","organizations_url":"https://api.github.com/users/sosickstudios/orgs","repos_url":"https://api.github.com/users/sosickstudios/repos","events_url":"https://api.github.com/users/sosickstudios/events{/privacy}","received_events_url":"https://api.github.com/users/sosickstudios/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sosickstudios/trainify","description":"Trainify.io ","fork":false,"url":"https://api.github.com/repos/sosickstudios/trainify","forks_url":"https://api.github.com/repos/sosickstudios/trainify/forks","keys_url":"https://api.github.com/repos/sosickstudios/trainify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sosickstudios/trainify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sosickstudios/trainify/teams","hooks_url":"https://api.github.com/repos/sosickstudios/trainify/hooks","issue_events_url":"https://api.github.com/repos/sosickstudios/trainify/issues/events{/number}","events_url":"https://api.github.com/repos/sosickstudios/trainify/events","assignees_url":"https://api.github.com/repos/sosickstudios/trainify/assignees{/user}","branches_url":"https://api.github.com/repos/sosickstudios/trainify/branches{/branch}","tags_url":"https://api.github.com/repos/sosickstudios/trainify/tags","blobs_url":"https://api.github.com/repos/sosickstudios/trainify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sosickstudios/trainify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sosickstudios/trainify/git/refs{/sha}","trees_url":"https://api.github.com/repos/sosickstudios/trainify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sosickstudios/trainify/statuses/{sha}","languages_url":"https://api.github.com/repos/sosickstudios/trainify/languages","stargazers_url":"https://api.github.com/repos/sosickstudios/trainify/stargazers","contributors_url":"https://api.github.com/repos/sosickstudios/trainify/contributors","subscribers_url":"https://api.github.com/repos/sosickstudios/trainify/subscribers","subscription_url":"https://api.github.com/repos/sosickstudios/trainify/subscription","commits_url":"https://api.github.com/repos/sosickstudios/trainify/commits{/sha}","git_commits_url":"https://api.github.com/repos/sosickstudios/trainify/git/commits{/sha}","comments_url":"https://api.github.com/repos/sosickstudios/trainify/comments{/number}","issue_comment_url":"https://api.github.com/repos/sosickstudios/trainify/issues/comments/{number}","contents_url":"https://api.github.com/repos/sosickstudios/trainify/contents/{+path}","compare_url":"https://api.github.com/repos/sosickstudios/trainify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sosickstudios/trainify/merges","archive_url":"https://api.github.com/repos/sosickstudios/trainify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sosickstudios/trainify/downloads","issues_url":"https://api.github.com/repos/sosickstudios/trainify/issues{/number}","pulls_url":"https://api.github.com/repos/sosickstudios/trainify/pulls{/number}","milestones_url":"https://api.github.com/repos/sosickstudios/trainify/milestones{/number}","notifications_url":"https://api.github.com/repos/sosickstudios/trainify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sosickstudios/trainify/labels{/name}","releases_url":"https://api.github.com/repos/sosickstudios/trainify/releases{/id}","created_at":"2014-07-10T21:11:04Z","updated_at":"2014-08-12T06:27:14Z","pushed_at":"2014-08-18T23:23:21Z","git_url":"git://github.com/sosickstudios/trainify.git","ssh_url":"git@github.com:sosickstudios/trainify.git","clone_url":"https://github.com/sosickstudios/trainify.git","svn_url":"https://github.com/sosickstudios/trainify","homepage":"https://trainify.io","size":33172,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"sosickstudios:master","ref":"master","sha":"68c5d258e8d94f630b423d60e9c1cd76c96237b4","user":{"login":"sosickstudios","id":8128963,"avatar_url":"https://avatars.githubusercontent.com/u/8128963?v=2","gravatar_id":null,"url":"https://api.github.com/users/sosickstudios","html_url":"https://github.com/sosickstudios","followers_url":"https://api.github.com/users/sosickstudios/followers","following_url":"https://api.github.com/users/sosickstudios/following{/other_user}","gists_url":"https://api.github.com/users/sosickstudios/gists{/gist_id}","starred_url":"https://api.github.com/users/sosickstudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sosickstudios/subscriptions","organizations_url":"https://api.github.com/users/sosickstudios/orgs","repos_url":"https://api.github.com/users/sosickstudios/repos","events_url":"https://api.github.com/users/sosickstudios/events{/privacy}","received_events_url":"https://api.github.com/users/sosickstudios/received_events","type":"Organization","site_admin":false},"repo":{"id":21710538,"name":"trainify","full_name":"sosickstudios/trainify","owner":{"login":"sosickstudios","id":8128963,"avatar_url":"https://avatars.githubusercontent.com/u/8128963?v=2","gravatar_id":null,"url":"https://api.github.com/users/sosickstudios","html_url":"https://github.com/sosickstudios","followers_url":"https://api.github.com/users/sosickstudios/followers","following_url":"https://api.github.com/users/sosickstudios/following{/other_user}","gists_url":"https://api.github.com/users/sosickstudios/gists{/gist_id}","starred_url":"https://api.github.com/users/sosickstudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sosickstudios/subscriptions","organizations_url":"https://api.github.com/users/sosickstudios/orgs","repos_url":"https://api.github.com/users/sosickstudios/repos","events_url":"https://api.github.com/users/sosickstudios/events{/privacy}","received_events_url":"https://api.github.com/users/sosickstudios/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sosickstudios/trainify","description":"Trainify.io ","fork":false,"url":"https://api.github.com/repos/sosickstudios/trainify","forks_url":"https://api.github.com/repos/sosickstudios/trainify/forks","keys_url":"https://api.github.com/repos/sosickstudios/trainify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sosickstudios/trainify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sosickstudios/trainify/teams","hooks_url":"https://api.github.com/repos/sosickstudios/trainify/hooks","issue_events_url":"https://api.github.com/repos/sosickstudios/trainify/issues/events{/number}","events_url":"https://api.github.com/repos/sosickstudios/trainify/events","assignees_url":"https://api.github.com/repos/sosickstudios/trainify/assignees{/user}","branches_url":"https://api.github.com/repos/sosickstudios/trainify/branches{/branch}","tags_url":"https://api.github.com/repos/sosickstudios/trainify/tags","blobs_url":"https://api.github.com/repos/sosickstudios/trainify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sosickstudios/trainify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sosickstudios/trainify/git/refs{/sha}","trees_url":"https://api.github.com/repos/sosickstudios/trainify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sosickstudios/trainify/statuses/{sha}","languages_url":"https://api.github.com/repos/sosickstudios/trainify/languages","stargazers_url":"https://api.github.com/repos/sosickstudios/trainify/stargazers","contributors_url":"https://api.github.com/repos/sosickstudios/trainify/contributors","subscribers_url":"https://api.github.com/repos/sosickstudios/trainify/subscribers","subscription_url":"https://api.github.com/repos/sosickstudios/trainify/subscription","commits_url":"https://api.github.com/repos/sosickstudios/trainify/commits{/sha}","git_commits_url":"https://api.github.com/repos/sosickstudios/trainify/git/commits{/sha}","comments_url":"https://api.github.com/repos/sosickstudios/trainify/comments{/number}","issue_comment_url":"https://api.github.com/repos/sosickstudios/trainify/issues/comments/{number}","contents_url":"https://api.github.com/repos/sosickstudios/trainify/contents/{+path}","compare_url":"https://api.github.com/repos/sosickstudios/trainify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sosickstudios/trainify/merges","archive_url":"https://api.github.com/repos/sosickstudios/trainify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sosickstudios/trainify/downloads","issues_url":"https://api.github.com/repos/sosickstudios/trainify/issues{/number}","pulls_url":"https://api.github.com/repos/sosickstudios/trainify/pulls{/number}","milestones_url":"https://api.github.com/repos/sosickstudios/trainify/milestones{/number}","notifications_url":"https://api.github.com/repos/sosickstudios/trainify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sosickstudios/trainify/labels{/name}","releases_url":"https://api.github.com/repos/sosickstudios/trainify/releases{/id}","created_at":"2014-07-10T21:11:04Z","updated_at":"2014-08-12T06:27:14Z","pushed_at":"2014-08-18T23:23:21Z","git_url":"git://github.com/sosickstudios/trainify.git","ssh_url":"git@github.com:sosickstudios/trainify.git","clone_url":"https://github.com/sosickstudios/trainify.git","svn_url":"https://github.com/sosickstudios/trainify","homepage":"https://trainify.io","size":33172,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/18"},"html":{"href":"https://github.com/sosickstudios/trainify/pull/18"},"issue":{"href":"https://api.github.com/repos/sosickstudios/trainify/issues/18"},"comments":{"href":"https://api.github.com/repos/sosickstudios/trainify/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sosickstudios/trainify/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/sosickstudios/trainify/statuses/3570a11107d6adce7d208c3844b0b9cb2b0c7d72"}}}}