{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fts_73/pulls/comments/89735723","pull_request_review_id":10271770,"id":89735723,"diff_hunk":"@@ -16,9 +20,41 @@ def create\n     end\n   end\n \n+  def update\n+    spent_time = ((Time.now - @exam.updated_at).to_i)*1000\n+    duration = @exam.subject.duration*60*1000\n+    spent_time = duration if spent_time > duration\n+    if @exam.update_attributes exam_params\n+      @exam.update_attributes status: 2\n+      @exam.update_attributes spent_time: spent_time\n+      redirect_to exams_path\n+    else\n+      flash[:danger] = t(\".update_faild\")\n+      redirect_to exams_path\n+    end\n+  end\n+\n+  def show\n+  end\n+\n+  def duration","path":"app/controllers/exams_controller.rb","position":35,"original_position":35,"commit_id":"df9acb22f5bd81df66ca8d99d6ee018b5fa2c565","original_commit_id":"df9acb22f5bd81df66ca8d99d6ee018b5fa2c565","user":{"login":"tranvantuanb","id":22876933,"avatar_url":"https://avatars.githubusercontent.com/u/22876933?v=3","gravatar_id":"","url":"https://api.github.com/users/tranvantuanb","html_url":"https://github.com/tranvantuanb","followers_url":"https://api.github.com/users/tranvantuanb/followers","following_url":"https://api.github.com/users/tranvantuanb/following{/other_user}","gists_url":"https://api.github.com/users/tranvantuanb/gists{/gist_id}","starred_url":"https://api.github.com/users/tranvantuanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tranvantuanb/subscriptions","organizations_url":"https://api.github.com/users/tranvantuanb/orgs","repos_url":"https://api.github.com/users/tranvantuanb/repos","events_url":"https://api.github.com/users/tranvantuanb/events{/privacy}","received_events_url":"https://api.github.com/users/tranvantuanb/received_events","type":"User","site_admin":false},"body":"t render json luôn ở exams controller vì t chỉ cần json thằng duration thôi nên t ngĩ k cần viết 1 controller riêng để xử lý.\r\nc thấy có ok?","created_at":"2016-11-28T08:39:15Z","updated_at":"2016-11-28T08:39:15Z","html_url":"https://github.com/framgia/fts_73/pull/8#discussion_r89735723","pull_request_url":"https://api.github.com/repos/framgia/fts_73/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/framgia/fts_73/pulls/comments/89735723"},"html":{"href":"https://github.com/framgia/fts_73/pull/8#discussion_r89735723"},"pull_request":{"href":"https://api.github.com/repos/framgia/fts_73/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fts_73/pulls/8","id":95409232,"html_url":"https://github.com/framgia/fts_73/pull/8","diff_url":"https://github.com/framgia/fts_73/pull/8.diff","patch_url":"https://github.com/framgia/fts_73/pull/8.patch","issue_url":"https://api.github.com/repos/framgia/fts_73/issues/8","number":8,"state":"open","locked":false,"title":"Add user do exam","user":{"login":"tranvantuanb","id":22876933,"avatar_url":"https://avatars.githubusercontent.com/u/22876933?v=3","gravatar_id":"","url":"https://api.github.com/users/tranvantuanb","html_url":"https://github.com/tranvantuanb","followers_url":"https://api.github.com/users/tranvantuanb/followers","following_url":"https://api.github.com/users/tranvantuanb/following{/other_user}","gists_url":"https://api.github.com/users/tranvantuanb/gists{/gist_id}","starred_url":"https://api.github.com/users/tranvantuanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tranvantuanb/subscriptions","organizations_url":"https://api.github.com/users/tranvantuanb/orgs","repos_url":"https://api.github.com/users/tranvantuanb/repos","events_url":"https://api.github.com/users/tranvantuanb/events{/privacy}","received_events_url":"https://api.github.com/users/tranvantuanb/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-27T17:17:00Z","updated_at":"2016-11-28T08:39:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87e742843f69b5ed5864cee155a351533c45c661","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fts_73/pulls/8/commits","review_comments_url":"https://api.github.com/repos/framgia/fts_73/pulls/8/comments","review_comment_url":"https://api.github.com/repos/framgia/fts_73/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fts_73/issues/8/comments","statuses_url":"https://api.github.com/repos/framgia/fts_73/statuses/df9acb22f5bd81df66ca8d99d6ee018b5fa2c565","head":{"label":"tranvantuanb:user-do-exam","ref":"user-do-exam","sha":"df9acb22f5bd81df66ca8d99d6ee018b5fa2c565","user":{"login":"tranvantuanb","id":22876933,"avatar_url":"https://avatars.githubusercontent.com/u/22876933?v=3","gravatar_id":"","url":"https://api.github.com/users/tranvantuanb","html_url":"https://github.com/tranvantuanb","followers_url":"https://api.github.com/users/tranvantuanb/followers","following_url":"https://api.github.com/users/tranvantuanb/following{/other_user}","gists_url":"https://api.github.com/users/tranvantuanb/gists{/gist_id}","starred_url":"https://api.github.com/users/tranvantuanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tranvantuanb/subscriptions","organizations_url":"https://api.github.com/users/tranvantuanb/orgs","repos_url":"https://api.github.com/users/tranvantuanb/repos","events_url":"https://api.github.com/users/tranvantuanb/events{/privacy}","received_events_url":"https://api.github.com/users/tranvantuanb/received_events","type":"User","site_admin":false},"repo":{"id":74536271,"name":"fts_73","full_name":"tranvantuanb/fts_73","owner":{"login":"tranvantuanb","id":22876933,"avatar_url":"https://avatars.githubusercontent.com/u/22876933?v=3","gravatar_id":"","url":"https://api.github.com/users/tranvantuanb","html_url":"https://github.com/tranvantuanb","followers_url":"https://api.github.com/users/tranvantuanb/followers","following_url":"https://api.github.com/users/tranvantuanb/following{/other_user}","gists_url":"https://api.github.com/users/tranvantuanb/gists{/gist_id}","starred_url":"https://api.github.com/users/tranvantuanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tranvantuanb/subscriptions","organizations_url":"https://api.github.com/users/tranvantuanb/orgs","repos_url":"https://api.github.com/users/tranvantuanb/repos","events_url":"https://api.github.com/users/tranvantuanb/events{/privacy}","received_events_url":"https://api.github.com/users/tranvantuanb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tranvantuanb/fts_73","description":"Framgia Test System (training)","fork":true,"url":"https://api.github.com/repos/tranvantuanb/fts_73","forks_url":"https://api.github.com/repos/tranvantuanb/fts_73/forks","keys_url":"https://api.github.com/repos/tranvantuanb/fts_73/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tranvantuanb/fts_73/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tranvantuanb/fts_73/teams","hooks_url":"https://api.github.com/repos/tranvantuanb/fts_73/hooks","issue_events_url":"https://api.github.com/repos/tranvantuanb/fts_73/issues/events{/number}","events_url":"https://api.github.com/repos/tranvantuanb/fts_73/events","assignees_url":"https://api.github.com/repos/tranvantuanb/fts_73/assignees{/user}","branches_url":"https://api.github.com/repos/tranvantuanb/fts_73/branches{/branch}","tags_url":"https://api.github.com/repos/tranvantuanb/fts_73/tags","blobs_url":"https://api.github.com/repos/tranvantuanb/fts_73/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tranvantuanb/fts_73/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tranvantuanb/fts_73/git/refs{/sha}","trees_url":"https://api.github.com/repos/tranvantuanb/fts_73/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tranvantuanb/fts_73/statuses/{sha}","languages_url":"https://api.github.com/repos/tranvantuanb/fts_73/languages","stargazers_url":"https://api.github.com/repos/tranvantuanb/fts_73/stargazers","contributors_url":"https://api.github.com/repos/tranvantuanb/fts_73/contributors","subscribers_url":"https://api.github.com/repos/tranvantuanb/fts_73/subscribers","subscription_url":"https://api.github.com/repos/tranvantuanb/fts_73/subscription","commits_url":"https://api.github.com/repos/tranvantuanb/fts_73/commits{/sha}","git_commits_url":"https://api.github.com/repos/tranvantuanb/fts_73/git/commits{/sha}","comments_url":"https://api.github.com/repos/tranvantuanb/fts_73/comments{/number}","issue_comment_url":"https://api.github.com/repos/tranvantuanb/fts_73/issues/comments{/number}","contents_url":"https://api.github.com/repos/tranvantuanb/fts_73/contents/{+path}","compare_url":"https://api.github.com/repos/tranvantuanb/fts_73/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tranvantuanb/fts_73/merges","archive_url":"https://api.github.com/repos/tranvantuanb/fts_73/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tranvantuanb/fts_73/downloads","issues_url":"https://api.github.com/repos/tranvantuanb/fts_73/issues{/number}","pulls_url":"https://api.github.com/repos/tranvantuanb/fts_73/pulls{/number}","milestones_url":"https://api.github.com/repos/tranvantuanb/fts_73/milestones{/number}","notifications_url":"https://api.github.com/repos/tranvantuanb/fts_73/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tranvantuanb/fts_73/labels{/name}","releases_url":"https://api.github.com/repos/tranvantuanb/fts_73/releases{/id}","deployments_url":"https://api.github.com/repos/tranvantuanb/fts_73/deployments","created_at":"2016-11-23T03:17:20Z","updated_at":"2016-11-22T08:51:24Z","pushed_at":"2016-11-28T08:13:51Z","git_url":"git://github.com/tranvantuanb/fts_73.git","ssh_url":"git@github.com:tranvantuanb/fts_73.git","clone_url":"https://github.com/tranvantuanb/fts_73.git","svn_url":"https://github.com/tranvantuanb/fts_73","homepage":null,"size":81,"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":"1d3f512c8aba4d01842773bfef7ecfc883c9fca2","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":74452867,"name":"fts_73","full_name":"framgia/fts_73","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_73","description":"Framgia Test System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fts_73","forks_url":"https://api.github.com/repos/framgia/fts_73/forks","keys_url":"https://api.github.com/repos/framgia/fts_73/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fts_73/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fts_73/teams","hooks_url":"https://api.github.com/repos/framgia/fts_73/hooks","issue_events_url":"https://api.github.com/repos/framgia/fts_73/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fts_73/events","assignees_url":"https://api.github.com/repos/framgia/fts_73/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fts_73/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fts_73/tags","blobs_url":"https://api.github.com/repos/framgia/fts_73/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fts_73/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fts_73/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fts_73/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fts_73/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fts_73/languages","stargazers_url":"https://api.github.com/repos/framgia/fts_73/stargazers","contributors_url":"https://api.github.com/repos/framgia/fts_73/contributors","subscribers_url":"https://api.github.com/repos/framgia/fts_73/subscribers","subscription_url":"https://api.github.com/repos/framgia/fts_73/subscription","commits_url":"https://api.github.com/repos/framgia/fts_73/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fts_73/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fts_73/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fts_73/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fts_73/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fts_73/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fts_73/merges","archive_url":"https://api.github.com/repos/framgia/fts_73/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fts_73/downloads","issues_url":"https://api.github.com/repos/framgia/fts_73/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fts_73/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fts_73/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fts_73/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fts_73/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fts_73/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fts_73/deployments","created_at":"2016-11-22T08:51:24Z","updated_at":"2016-11-22T08:51:24Z","pushed_at":"2016-11-28T08:13:51Z","git_url":"git://github.com/framgia/fts_73.git","ssh_url":"git@github.com:framgia/fts_73.git","clone_url":"https://github.com/framgia/fts_73.git","svn_url":"https://github.com/framgia/fts_73","homepage":null,"size":73,"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_73/pulls/8"},"html":{"href":"https://github.com/framgia/fts_73/pull/8"},"issue":{"href":"https://api.github.com/repos/framgia/fts_73/issues/8"},"comments":{"href":"https://api.github.com/repos/framgia/fts_73/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fts_73/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fts_73/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fts_73/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fts_73/statuses/df9acb22f5bd81df66ca8d99d6ee018b5fa2c565"}}}}
{"actor":{"display_login":"tranvantuanb"}}