{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fts_45/pulls/comments/46245818","id":46245818,"diff_hunk":"@@ -26,6 +27,29 @@ def calculated_score\n     self.results.correct.count\n   end\n \n+  def auto_check\n+    self.results.each do |result|\n+      question = result.question\n+      if question.text?\n+        result.update_column :is_correct, true if\n+          question.answers[0].content == result.answer_content[0]\n+      else\n+        result.update_column :is_correct, true if\n+          (result.question.answers.correct.ids.map{|id| id.to_s} -\n+          result.answer_content).empty?\n+      end\n+    end\n+    self.update_status :checked\n+  end\n+\n+  def is_checked?","path":"app/models/exam.rb","position":29,"original_position":29,"commit_id":"2938873841e5731a603bcf6035ecd095553da129","original_commit_id":"2938873841e5731a603bcf6035ecd095553da129","user":{"login":"hellovietnam93","id":8023606,"avatar_url":"https://avatars.githubusercontent.com/u/8023606?v=3","gravatar_id":"","url":"https://api.github.com/users/hellovietnam93","html_url":"https://github.com/hellovietnam93","followers_url":"https://api.github.com/users/hellovietnam93/followers","following_url":"https://api.github.com/users/hellovietnam93/following{/other_user}","gists_url":"https://api.github.com/users/hellovietnam93/gists{/gist_id}","starred_url":"https://api.github.com/users/hellovietnam93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellovietnam93/subscriptions","organizations_url":"https://api.github.com/users/hellovietnam93/orgs","repos_url":"https://api.github.com/users/hellovietnam93/repos","events_url":"https://api.github.com/users/hellovietnam93/events{/privacy}","received_events_url":"https://api.github.com/users/hellovietnam93/received_events","type":"User","site_admin":false},"body":"private","created_at":"2015-12-01T07:04:24Z","updated_at":"2015-12-01T07:04:24Z","html_url":"https://github.com/framgia/fts_45/pull/14#discussion_r46245818","pull_request_url":"https://api.github.com/repos/framgia/fts_45/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/comments/46245818"},"html":{"href":"https://github.com/framgia/fts_45/pull/14#discussion_r46245818"},"pull_request":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fts_45/pulls/14","id":52220902,"html_url":"https://github.com/framgia/fts_45/pull/14","diff_url":"https://github.com/framgia/fts_45/pull/14.diff","patch_url":"https://github.com/framgia/fts_45/pull/14.patch","issue_url":"https://api.github.com/repos/framgia/fts_45/issues/14","number":14,"state":"open","locked":false,"title":"sidekiq-auto-check-exam","user":{"login":"tannm13","id":14290164,"avatar_url":"https://avatars.githubusercontent.com/u/14290164?v=3","gravatar_id":"","url":"https://api.github.com/users/tannm13","html_url":"https://github.com/tannm13","followers_url":"https://api.github.com/users/tannm13/followers","following_url":"https://api.github.com/users/tannm13/following{/other_user}","gists_url":"https://api.github.com/users/tannm13/gists{/gist_id}","starred_url":"https://api.github.com/users/tannm13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannm13/subscriptions","organizations_url":"https://api.github.com/users/tannm13/orgs","repos_url":"https://api.github.com/users/tannm13/repos","events_url":"https://api.github.com/users/tannm13/events{/privacy}","received_events_url":"https://api.github.com/users/tannm13/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-01T06:27:25Z","updated_at":"2015-12-01T07:04:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c3ec5a1da34f80d76fde2d918aeaeae1fc03f51c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fts_45/pulls/14/commits","review_comments_url":"https://api.github.com/repos/framgia/fts_45/pulls/14/comments","review_comment_url":"https://api.github.com/repos/framgia/fts_45/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fts_45/issues/14/comments","statuses_url":"https://api.github.com/repos/framgia/fts_45/statuses/2938873841e5731a603bcf6035ecd095553da129","head":{"label":"tannm13:add-sidekiq-jobs","ref":"add-sidekiq-jobs","sha":"2938873841e5731a603bcf6035ecd095553da129","user":{"login":"tannm13","id":14290164,"avatar_url":"https://avatars.githubusercontent.com/u/14290164?v=3","gravatar_id":"","url":"https://api.github.com/users/tannm13","html_url":"https://github.com/tannm13","followers_url":"https://api.github.com/users/tannm13/followers","following_url":"https://api.github.com/users/tannm13/following{/other_user}","gists_url":"https://api.github.com/users/tannm13/gists{/gist_id}","starred_url":"https://api.github.com/users/tannm13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannm13/subscriptions","organizations_url":"https://api.github.com/users/tannm13/orgs","repos_url":"https://api.github.com/users/tannm13/repos","events_url":"https://api.github.com/users/tannm13/events{/privacy}","received_events_url":"https://api.github.com/users/tannm13/received_events","type":"User","site_admin":false},"repo":{"id":46700667,"name":"fts_45","full_name":"tannm13/fts_45","owner":{"login":"tannm13","id":14290164,"avatar_url":"https://avatars.githubusercontent.com/u/14290164?v=3","gravatar_id":"","url":"https://api.github.com/users/tannm13","html_url":"https://github.com/tannm13","followers_url":"https://api.github.com/users/tannm13/followers","following_url":"https://api.github.com/users/tannm13/following{/other_user}","gists_url":"https://api.github.com/users/tannm13/gists{/gist_id}","starred_url":"https://api.github.com/users/tannm13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannm13/subscriptions","organizations_url":"https://api.github.com/users/tannm13/orgs","repos_url":"https://api.github.com/users/tannm13/repos","events_url":"https://api.github.com/users/tannm13/events{/privacy}","received_events_url":"https://api.github.com/users/tannm13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tannm13/fts_45","description":"Framgia Test System (training)","fork":true,"url":"https://api.github.com/repos/tannm13/fts_45","forks_url":"https://api.github.com/repos/tannm13/fts_45/forks","keys_url":"https://api.github.com/repos/tannm13/fts_45/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tannm13/fts_45/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tannm13/fts_45/teams","hooks_url":"https://api.github.com/repos/tannm13/fts_45/hooks","issue_events_url":"https://api.github.com/repos/tannm13/fts_45/issues/events{/number}","events_url":"https://api.github.com/repos/tannm13/fts_45/events","assignees_url":"https://api.github.com/repos/tannm13/fts_45/assignees{/user}","branches_url":"https://api.github.com/repos/tannm13/fts_45/branches{/branch}","tags_url":"https://api.github.com/repos/tannm13/fts_45/tags","blobs_url":"https://api.github.com/repos/tannm13/fts_45/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tannm13/fts_45/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tannm13/fts_45/git/refs{/sha}","trees_url":"https://api.github.com/repos/tannm13/fts_45/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tannm13/fts_45/statuses/{sha}","languages_url":"https://api.github.com/repos/tannm13/fts_45/languages","stargazers_url":"https://api.github.com/repos/tannm13/fts_45/stargazers","contributors_url":"https://api.github.com/repos/tannm13/fts_45/contributors","subscribers_url":"https://api.github.com/repos/tannm13/fts_45/subscribers","subscription_url":"https://api.github.com/repos/tannm13/fts_45/subscription","commits_url":"https://api.github.com/repos/tannm13/fts_45/commits{/sha}","git_commits_url":"https://api.github.com/repos/tannm13/fts_45/git/commits{/sha}","comments_url":"https://api.github.com/repos/tannm13/fts_45/comments{/number}","issue_comment_url":"https://api.github.com/repos/tannm13/fts_45/issues/comments{/number}","contents_url":"https://api.github.com/repos/tannm13/fts_45/contents/{+path}","compare_url":"https://api.github.com/repos/tannm13/fts_45/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tannm13/fts_45/merges","archive_url":"https://api.github.com/repos/tannm13/fts_45/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tannm13/fts_45/downloads","issues_url":"https://api.github.com/repos/tannm13/fts_45/issues{/number}","pulls_url":"https://api.github.com/repos/tannm13/fts_45/pulls{/number}","milestones_url":"https://api.github.com/repos/tannm13/fts_45/milestones{/number}","notifications_url":"https://api.github.com/repos/tannm13/fts_45/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tannm13/fts_45/labels{/name}","releases_url":"https://api.github.com/repos/tannm13/fts_45/releases{/id}","created_at":"2015-11-23T06:21:06Z","updated_at":"2015-11-23T02:12:08Z","pushed_at":"2015-12-01T07:00:16Z","git_url":"git://github.com/tannm13/fts_45.git","ssh_url":"git@github.com:tannm13/fts_45.git","clone_url":"https://github.com/tannm13/fts_45.git","svn_url":"https://github.com/tannm13/fts_45","homepage":null,"size":74,"stargazers_count":0,"watchers_count":0,"language":null,"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":"framgia:develop","ref":"develop","sha":"be575bacb210f77bdaf8b6338c40a0e92becb5a0","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":46691303,"name":"fts_45","full_name":"framgia/fts_45","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fts_45","description":"Framgia Test System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fts_45","forks_url":"https://api.github.com/repos/framgia/fts_45/forks","keys_url":"https://api.github.com/repos/framgia/fts_45/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fts_45/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fts_45/teams","hooks_url":"https://api.github.com/repos/framgia/fts_45/hooks","issue_events_url":"https://api.github.com/repos/framgia/fts_45/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fts_45/events","assignees_url":"https://api.github.com/repos/framgia/fts_45/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fts_45/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fts_45/tags","blobs_url":"https://api.github.com/repos/framgia/fts_45/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fts_45/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fts_45/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fts_45/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fts_45/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fts_45/languages","stargazers_url":"https://api.github.com/repos/framgia/fts_45/stargazers","contributors_url":"https://api.github.com/repos/framgia/fts_45/contributors","subscribers_url":"https://api.github.com/repos/framgia/fts_45/subscribers","subscription_url":"https://api.github.com/repos/framgia/fts_45/subscription","commits_url":"https://api.github.com/repos/framgia/fts_45/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fts_45/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fts_45/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fts_45/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fts_45/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fts_45/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fts_45/merges","archive_url":"https://api.github.com/repos/framgia/fts_45/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fts_45/downloads","issues_url":"https://api.github.com/repos/framgia/fts_45/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fts_45/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fts_45/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fts_45/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fts_45/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fts_45/releases{/id}","created_at":"2015-11-23T02:12:08Z","updated_at":"2015-11-23T02:12:08Z","pushed_at":"2015-12-01T07:03:34Z","git_url":"git://github.com/framgia/fts_45.git","ssh_url":"git@github.com:framgia/fts_45.git","clone_url":"https://github.com/framgia/fts_45.git","svn_url":"https://github.com/framgia/fts_45","homepage":null,"size":71,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/14"},"html":{"href":"https://github.com/framgia/fts_45/pull/14"},"issue":{"href":"https://api.github.com/repos/framgia/fts_45/issues/14"},"comments":{"href":"https://api.github.com/repos/framgia/fts_45/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fts_45/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fts_45/statuses/2938873841e5731a603bcf6035ecd095553da129"}}}}