{"action":"created","comment":{"url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/comments/70762743","id":70762743,"diff_hunk":"@@ -20,12 +20,21 @@ router.post('/check/:qno(\\\\d+)?', middleware.isAuthenticated, (req, res) => {\n   var { qno } = req.params;\n   const { answer } = req.body;\n   const { lastQuestionAllowed } = req.user;\n+  const {score} = req.user;\n   if (!qno) qno = lastQuestionAllowed;\n   if (qno > lastQuestionAllowed) {res.sendStatus(403); return false;}\n   models.Question.findOne({where : { qno }})\n     .then(question => {\n       if (question) {\n-        if (question.answer == answer && qno ==lastQuestionAllowed) req.user.update({lastQuestionAllowed: lastQuestionAllowed + 1});\n+        if (question.answer == answer && qno ==lastQuestionAllowed)\n+        {\n+\t  req.user.update({ score: score + 10});","path":"src/question.js","position":13,"original_position":13,"commit_id":"6edc6e1d0d3e84227adc4cf60706c47b6fcd0f51","original_commit_id":"6edc6e1d0d3e84227adc4cf60706c47b6fcd0f51","user":{"login":"meghprkh","id":5979605,"avatar_url":"https://avatars.githubusercontent.com/u/5979605?v=3","gravatar_id":"","url":"https://api.github.com/users/meghprkh","html_url":"https://github.com/meghprkh","followers_url":"https://api.github.com/users/meghprkh/followers","following_url":"https://api.github.com/users/meghprkh/following{/other_user}","gists_url":"https://api.github.com/users/meghprkh/gists{/gist_id}","starred_url":"https://api.github.com/users/meghprkh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meghprkh/subscriptions","organizations_url":"https://api.github.com/users/meghprkh/orgs","repos_url":"https://api.github.com/users/meghprkh/repos","events_url":"https://api.github.com/users/meghprkh/events{/privacy}","received_events_url":"https://api.github.com/users/meghprkh/received_events","type":"User","site_admin":false},"body":"IMO we can put these constants (`scoreIncrement` and `scoreDecrement`) in `config.js` and use them from there","created_at":"2016-07-14T07:47:43Z","updated_at":"2016-07-14T07:47:43Z","html_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10#discussion_r70762743","pull_request_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/comments/70762743"},"html":{"href":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10#discussion_r70762743"},"pull_request":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10","id":77370081,"html_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10","diff_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10.diff","patch_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10.patch","issue_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/10","number":10,"state":"open","locked":false,"title":"Resolved Issue#2 - Added a scoring system","user":{"login":"pranavbhasin96","id":14216937,"avatar_url":"https://avatars.githubusercontent.com/u/14216937?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavbhasin96","html_url":"https://github.com/pranavbhasin96","followers_url":"https://api.github.com/users/pranavbhasin96/followers","following_url":"https://api.github.com/users/pranavbhasin96/following{/other_user}","gists_url":"https://api.github.com/users/pranavbhasin96/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavbhasin96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavbhasin96/subscriptions","organizations_url":"https://api.github.com/users/pranavbhasin96/orgs","repos_url":"https://api.github.com/users/pranavbhasin96/repos","events_url":"https://api.github.com/users/pranavbhasin96/events{/privacy}","received_events_url":"https://api.github.com/users/pranavbhasin96/received_events","type":"User","site_admin":false},"body":"I added a scoring system where on correct answer you get 10 points and on wrong answer you get -5 points.\r\nNow, As you can access to a new question only when you have completed all other questions before it, you get +10 score or -5 score only on the respective lastQuestionAllowed. \r\nAlso, i have not put any limit on -5, as many times as the user will give a wrong answer, he will get a -5 (only on the lastQuestionAllowed, ofcourse).","created_at":"2016-07-13T22:07:01Z","updated_at":"2016-07-14T07:47:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"663154a6dc8fe2f3e19a56a4f3d461b7355293e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10/commits","review_comments_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10/comments","review_comment_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/10/comments","statuses_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/statuses/6edc6e1d0d3e84227adc4cf60706c47b6fcd0f51","head":{"label":"pranavbhasin96:master","ref":"master","sha":"6edc6e1d0d3e84227adc4cf60706c47b6fcd0f51","user":{"login":"pranavbhasin96","id":14216937,"avatar_url":"https://avatars.githubusercontent.com/u/14216937?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavbhasin96","html_url":"https://github.com/pranavbhasin96","followers_url":"https://api.github.com/users/pranavbhasin96/followers","following_url":"https://api.github.com/users/pranavbhasin96/following{/other_user}","gists_url":"https://api.github.com/users/pranavbhasin96/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavbhasin96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavbhasin96/subscriptions","organizations_url":"https://api.github.com/users/pranavbhasin96/orgs","repos_url":"https://api.github.com/users/pranavbhasin96/repos","events_url":"https://api.github.com/users/pranavbhasin96/events{/privacy}","received_events_url":"https://api.github.com/users/pranavbhasin96/received_events","type":"User","site_admin":false},"repo":{"id":63281310,"name":"quiz-portal-backend","full_name":"pranavbhasin96/quiz-portal-backend","owner":{"login":"pranavbhasin96","id":14216937,"avatar_url":"https://avatars.githubusercontent.com/u/14216937?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavbhasin96","html_url":"https://github.com/pranavbhasin96","followers_url":"https://api.github.com/users/pranavbhasin96/followers","following_url":"https://api.github.com/users/pranavbhasin96/following{/other_user}","gists_url":"https://api.github.com/users/pranavbhasin96/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavbhasin96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavbhasin96/subscriptions","organizations_url":"https://api.github.com/users/pranavbhasin96/orgs","repos_url":"https://api.github.com/users/pranavbhasin96/repos","events_url":"https://api.github.com/users/pranavbhasin96/events{/privacy}","received_events_url":"https://api.github.com/users/pranavbhasin96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pranavbhasin96/quiz-portal-backend","description":"The generic quiz portal's backend","fork":true,"url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend","forks_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/forks","keys_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/teams","hooks_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/hooks","issue_events_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/issues/events{/number}","events_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/events","assignees_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/assignees{/user}","branches_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/branches{/branch}","tags_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/tags","blobs_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/languages","stargazers_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/stargazers","contributors_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/contributors","subscribers_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/subscribers","subscription_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/subscription","commits_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/contents/{+path}","compare_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/merges","archive_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/downloads","issues_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/issues{/number}","pulls_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/labels{/name}","releases_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/releases{/id}","deployments_url":"https://api.github.com/repos/pranavbhasin96/quiz-portal-backend/deployments","created_at":"2016-07-13T21:37:43Z","updated_at":"2016-07-13T21:37:44Z","pushed_at":"2016-07-13T21:57:21Z","git_url":"git://github.com/pranavbhasin96/quiz-portal-backend.git","ssh_url":"git@github.com:pranavbhasin96/quiz-portal-backend.git","clone_url":"https://github.com/pranavbhasin96/quiz-portal-backend.git","svn_url":"https://github.com/pranavbhasin96/quiz-portal-backend","homepage":null,"size":9,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"felicity-buzz-2k16:master","ref":"master","sha":"f9b0c71659905957d84c700d3ef8c8b93b52db21","user":{"login":"felicity-buzz-2k16","id":20180294,"avatar_url":"https://avatars.githubusercontent.com/u/20180294?v=3","gravatar_id":"","url":"https://api.github.com/users/felicity-buzz-2k16","html_url":"https://github.com/felicity-buzz-2k16","followers_url":"https://api.github.com/users/felicity-buzz-2k16/followers","following_url":"https://api.github.com/users/felicity-buzz-2k16/following{/other_user}","gists_url":"https://api.github.com/users/felicity-buzz-2k16/gists{/gist_id}","starred_url":"https://api.github.com/users/felicity-buzz-2k16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felicity-buzz-2k16/subscriptions","organizations_url":"https://api.github.com/users/felicity-buzz-2k16/orgs","repos_url":"https://api.github.com/users/felicity-buzz-2k16/repos","events_url":"https://api.github.com/users/felicity-buzz-2k16/events{/privacy}","received_events_url":"https://api.github.com/users/felicity-buzz-2k16/received_events","type":"Organization","site_admin":false},"repo":{"id":62312306,"name":"quiz-portal-backend","full_name":"felicity-buzz-2k16/quiz-portal-backend","owner":{"login":"felicity-buzz-2k16","id":20180294,"avatar_url":"https://avatars.githubusercontent.com/u/20180294?v=3","gravatar_id":"","url":"https://api.github.com/users/felicity-buzz-2k16","html_url":"https://github.com/felicity-buzz-2k16","followers_url":"https://api.github.com/users/felicity-buzz-2k16/followers","following_url":"https://api.github.com/users/felicity-buzz-2k16/following{/other_user}","gists_url":"https://api.github.com/users/felicity-buzz-2k16/gists{/gist_id}","starred_url":"https://api.github.com/users/felicity-buzz-2k16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felicity-buzz-2k16/subscriptions","organizations_url":"https://api.github.com/users/felicity-buzz-2k16/orgs","repos_url":"https://api.github.com/users/felicity-buzz-2k16/repos","events_url":"https://api.github.com/users/felicity-buzz-2k16/events{/privacy}","received_events_url":"https://api.github.com/users/felicity-buzz-2k16/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend","description":"The generic quiz portal's backend","fork":false,"url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend","forks_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/forks","keys_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/teams","hooks_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/hooks","issue_events_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/events{/number}","events_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/events","assignees_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/assignees{/user}","branches_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/branches{/branch}","tags_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/tags","blobs_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/languages","stargazers_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/stargazers","contributors_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/contributors","subscribers_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/subscribers","subscription_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/subscription","commits_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/contents/{+path}","compare_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/merges","archive_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/downloads","issues_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues{/number}","pulls_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/labels{/name}","releases_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/releases{/id}","deployments_url":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/deployments","created_at":"2016-06-30T13:21:24Z","updated_at":"2016-06-30T13:22:11Z","pushed_at":"2016-07-13T22:07:01Z","git_url":"git://github.com/felicity-buzz-2k16/quiz-portal-backend.git","ssh_url":"git@github.com:felicity-buzz-2k16/quiz-portal-backend.git","clone_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend.git","svn_url":"https://github.com/felicity-buzz-2k16/quiz-portal-backend","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10"},"html":{"href":"https://github.com/felicity-buzz-2k16/quiz-portal-backend/pull/10"},"issue":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/10"},"comments":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/felicity-buzz-2k16/quiz-portal-backend/statuses/6edc6e1d0d3e84227adc4cf60706c47b6fcd0f51"}}}}
{"actor":{"display_login":"meghprkh"}}