{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_123/pulls/comments/60858150","id":60858150,"diff_hunk":"@@ -0,0 +1,56 @@\n+class LessonsController < ApplicationController\n+  before_action :logged_in_user\n+  before_action :find_category, only: [:create, :show, :update]\n+  before_action :find_lesson, only: [:show, :update]\n+  before_action :correct_user, only: [:update]\n+\n+  def create\n+    @lesson = Lesson.new category_id: @category.id, user_id: current_user.id\n+    if @lesson.save\n+      flash[:success] = t \"create_success\"\n+      redirect_to category_lesson_path @category, @lesson\n+    else\n+      flash[:danger] = @lesson.errors.full_messages\n+      redirect_to @category\n+    end\n+  end\n+\n+  def show\n+    if !@lesson.number_of_correct_answer.nil?","path":"app/controllers/lessons_controller.rb","position":19,"original_position":19,"commit_id":"1b7a4f1c295a658336c0d3749293d376b5e23f5f","original_commit_id":"1b7a4f1c295a658336c0d3749293d376b5e23f5f","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":"đảo ngược lại đi ","created_at":"2016-04-25T02:28:22Z","updated_at":"2016-04-25T02:28:22Z","html_url":"https://github.com/framgia/fels_123/pull/22#discussion_r60858150","pull_request_url":"https://api.github.com/repos/framgia/fels_123/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/comments/60858150"},"html":{"href":"https://github.com/framgia/fels_123/pull/22#discussion_r60858150"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_123/pulls/22","id":67506028,"html_url":"https://github.com/framgia/fels_123/pull/22","diff_url":"https://github.com/framgia/fels_123/pull/22.diff","patch_url":"https://github.com/framgia/fels_123/pull/22.patch","issue_url":"https://api.github.com/repos/framgia/fels_123/issues/22","number":22,"state":"open","locked":false,"title":"Make_Lesson_Solve_Problem","user":{"login":"tanphan313","id":14685271,"avatar_url":"https://avatars.githubusercontent.com/u/14685271?v=3","gravatar_id":"","url":"https://api.github.com/users/tanphan313","html_url":"https://github.com/tanphan313","followers_url":"https://api.github.com/users/tanphan313/followers","following_url":"https://api.github.com/users/tanphan313/following{/other_user}","gists_url":"https://api.github.com/users/tanphan313/gists{/gist_id}","starred_url":"https://api.github.com/users/tanphan313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanphan313/subscriptions","organizations_url":"https://api.github.com/users/tanphan313/orgs","repos_url":"https://api.github.com/users/tanphan313/repos","events_url":"https://api.github.com/users/tanphan313/events{/privacy}","received_events_url":"https://api.github.com/users/tanphan313/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-22T12:49:43Z","updated_at":"2016-04-25T02:28:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"086a9f78ce621530079e9d133d9a04a6caab1bf6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_123/pulls/22/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_123/pulls/22/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_123/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_123/issues/22/comments","statuses_url":"https://api.github.com/repos/framgia/fels_123/statuses/1b7a4f1c295a658336c0d3749293d376b5e23f5f","head":{"label":"tanphan313:58620_Solve_Problem_On_Lesson_Page","ref":"58620_Solve_Problem_On_Lesson_Page","sha":"1b7a4f1c295a658336c0d3749293d376b5e23f5f","user":{"login":"tanphan313","id":14685271,"avatar_url":"https://avatars.githubusercontent.com/u/14685271?v=3","gravatar_id":"","url":"https://api.github.com/users/tanphan313","html_url":"https://github.com/tanphan313","followers_url":"https://api.github.com/users/tanphan313/followers","following_url":"https://api.github.com/users/tanphan313/following{/other_user}","gists_url":"https://api.github.com/users/tanphan313/gists{/gist_id}","starred_url":"https://api.github.com/users/tanphan313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanphan313/subscriptions","organizations_url":"https://api.github.com/users/tanphan313/orgs","repos_url":"https://api.github.com/users/tanphan313/repos","events_url":"https://api.github.com/users/tanphan313/events{/privacy}","received_events_url":"https://api.github.com/users/tanphan313/received_events","type":"User","site_admin":false},"repo":{"id":55377344,"name":"fels_123","full_name":"tanphan313/fels_123","owner":{"login":"tanphan313","id":14685271,"avatar_url":"https://avatars.githubusercontent.com/u/14685271?v=3","gravatar_id":"","url":"https://api.github.com/users/tanphan313","html_url":"https://github.com/tanphan313","followers_url":"https://api.github.com/users/tanphan313/followers","following_url":"https://api.github.com/users/tanphan313/following{/other_user}","gists_url":"https://api.github.com/users/tanphan313/gists{/gist_id}","starred_url":"https://api.github.com/users/tanphan313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanphan313/subscriptions","organizations_url":"https://api.github.com/users/tanphan313/orgs","repos_url":"https://api.github.com/users/tanphan313/repos","events_url":"https://api.github.com/users/tanphan313/events{/privacy}","received_events_url":"https://api.github.com/users/tanphan313/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tanphan313/fels_123","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/tanphan313/fels_123","forks_url":"https://api.github.com/repos/tanphan313/fels_123/forks","keys_url":"https://api.github.com/repos/tanphan313/fels_123/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tanphan313/fels_123/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tanphan313/fels_123/teams","hooks_url":"https://api.github.com/repos/tanphan313/fels_123/hooks","issue_events_url":"https://api.github.com/repos/tanphan313/fels_123/issues/events{/number}","events_url":"https://api.github.com/repos/tanphan313/fels_123/events","assignees_url":"https://api.github.com/repos/tanphan313/fels_123/assignees{/user}","branches_url":"https://api.github.com/repos/tanphan313/fels_123/branches{/branch}","tags_url":"https://api.github.com/repos/tanphan313/fels_123/tags","blobs_url":"https://api.github.com/repos/tanphan313/fels_123/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tanphan313/fels_123/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tanphan313/fels_123/git/refs{/sha}","trees_url":"https://api.github.com/repos/tanphan313/fels_123/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tanphan313/fels_123/statuses/{sha}","languages_url":"https://api.github.com/repos/tanphan313/fels_123/languages","stargazers_url":"https://api.github.com/repos/tanphan313/fels_123/stargazers","contributors_url":"https://api.github.com/repos/tanphan313/fels_123/contributors","subscribers_url":"https://api.github.com/repos/tanphan313/fels_123/subscribers","subscription_url":"https://api.github.com/repos/tanphan313/fels_123/subscription","commits_url":"https://api.github.com/repos/tanphan313/fels_123/commits{/sha}","git_commits_url":"https://api.github.com/repos/tanphan313/fels_123/git/commits{/sha}","comments_url":"https://api.github.com/repos/tanphan313/fels_123/comments{/number}","issue_comment_url":"https://api.github.com/repos/tanphan313/fels_123/issues/comments{/number}","contents_url":"https://api.github.com/repos/tanphan313/fels_123/contents/{+path}","compare_url":"https://api.github.com/repos/tanphan313/fels_123/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tanphan313/fels_123/merges","archive_url":"https://api.github.com/repos/tanphan313/fels_123/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tanphan313/fels_123/downloads","issues_url":"https://api.github.com/repos/tanphan313/fels_123/issues{/number}","pulls_url":"https://api.github.com/repos/tanphan313/fels_123/pulls{/number}","milestones_url":"https://api.github.com/repos/tanphan313/fels_123/milestones{/number}","notifications_url":"https://api.github.com/repos/tanphan313/fels_123/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tanphan313/fels_123/labels{/name}","releases_url":"https://api.github.com/repos/tanphan313/fels_123/releases{/id}","deployments_url":"https://api.github.com/repos/tanphan313/fels_123/deployments","created_at":"2016-04-04T01:05:21Z","updated_at":"2016-03-21T03:35:54Z","pushed_at":"2016-04-24T04:34:39Z","git_url":"git://github.com/tanphan313/fels_123.git","ssh_url":"git@github.com:tanphan313/fels_123.git","clone_url":"https://github.com/tanphan313/fels_123.git","svn_url":"https://github.com/tanphan313/fels_123","homepage":null,"size":404,"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":"b21fe2442513aa3ee412422111c419975042322b","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":54357536,"name":"fels_123","full_name":"framgia/fels_123","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/fels_123","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_123","forks_url":"https://api.github.com/repos/framgia/fels_123/forks","keys_url":"https://api.github.com/repos/framgia/fels_123/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_123/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_123/teams","hooks_url":"https://api.github.com/repos/framgia/fels_123/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_123/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_123/events","assignees_url":"https://api.github.com/repos/framgia/fels_123/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_123/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_123/tags","blobs_url":"https://api.github.com/repos/framgia/fels_123/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_123/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_123/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_123/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_123/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_123/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_123/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_123/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_123/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_123/subscription","commits_url":"https://api.github.com/repos/framgia/fels_123/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_123/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_123/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_123/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_123/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_123/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_123/merges","archive_url":"https://api.github.com/repos/framgia/fels_123/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_123/downloads","issues_url":"https://api.github.com/repos/framgia/fels_123/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_123/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_123/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_123/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_123/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_123/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_123/deployments","created_at":"2016-03-21T03:35:54Z","updated_at":"2016-03-21T03:35:54Z","pushed_at":"2016-04-24T04:34:39Z","git_url":"git://github.com/framgia/fels_123.git","ssh_url":"git@github.com:framgia/fels_123.git","clone_url":"https://github.com/framgia/fels_123.git","svn_url":"https://github.com/framgia/fels_123","homepage":null,"size":404,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/22"},"html":{"href":"https://github.com/framgia/fels_123/pull/22"},"issue":{"href":"https://api.github.com/repos/framgia/fels_123/issues/22"},"comments":{"href":"https://api.github.com/repos/framgia/fels_123/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_123/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_123/statuses/1b7a4f1c295a658336c0d3749293d376b5e23f5f"}}}}