{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_166/pulls/comments/73101010","id":73101010,"diff_hunk":"@@ -60,3 +46,58 @@ $(document).on 'ready page:load', ->\n           $('.category_notifi').removeClass('hidden')\n         return false\n     return false\n+  $('.admin_choose_answer').on 'click', (event) ->\n+    el = $(this)\n+    $('.row-word-answer').find('.row').each ->\n+      $($(this).find('input')[1]).prop(\"checked\", false)\n+      correct_answer_input = $(this).find('input')[4]\n+      $(correct_answer_input).val(0)\n+    $(this).prop(\"checked\", true)\n+    id = $(el).attr('id').replace('_true', '');\n+    $('#'+id).val(1)\n+\n+  $('.admin_add_word_answer').on 'click', (event) ->\n+    el = $(this)\n+    answer_count = parseInt $('#word_answer_count').val()\n+    row_count = $('.row-word-answer').children('.row').length - $('.row-word-answer').children('.row.hidden').length\n+    if 1 <= row_count < 5\n+      answer_count = answer_count + 1\n+      strVar = \"\";\n+      strVar += \"<div id=\\\"row-1\\\" class=\\\"row\\\">\";\n+      strVar += \"<div class=\\\"form-group\\\">\";\n+      strVar += \"<div class=\\\"col-md-8\\\">\";\n+      strVar += \"<input type=\\\"text\\\" id=\\\"word_word_answers_attributes_\"+answer_count+\"_content\\\"\"\n+      strVar += \"name=\\\"word[word_answers_attributes][\"+answer_count+\"][content]\\\"\"\n+      strVar += \"class=\\\"form-control\\\">\";\n+      strVar += \"<\\/div>\";\n+      strVar += \"<div class=\\\"col-md-1\\\">\";\n+      strVar += \"<input type=\\\"radio\\\" id=\\\"word_word_answers_attributes_\"+answer_count+\"_is_correct_true\\\" name=\\\"word[word_answers_attributes][\"+answer_count+\"][is_correct]\\\" value=\\\"true\\\" class=\\\"admin_choose_answer\\\">\";\n+      strVar += \"<\\/div>\";\n+      strVar += \"<div class=\\\"col-md-2\\\">\";\n+      strVar += \"<input type=\\\"hidden\\\" value=\\\"0\\\" name=\\\"word[word_answers_attributes][\"+answer_count+\"][_destroy]\\\"><input type=\\\"checkbox\\\" id=\\\"word_word_answers_attributes_1__destroy\\\" name=\\\"word[word_answers_attributes][\"+answer_count+\"][_destroy]\\\" value=\\\"1\\\" class=\\\"hidden\\\">\";\n+      strVar += \"<input type=\\\"hidden\\\" id=\\\"word_word_answers_attributes_1_is_correct\\\" name=\\\"word[word_answers_attributes][\"+answer_count+\"][is_correct]\\\">\";\n+      strVar += \"<button class=\\\"btn glyphicon glyphicon-trash \";\n+      strVar += \"admin_delete_word_answer\\\" type=\\\"button\\\" name=\\\"button\\\"><\\/button>\";\n+      strVar += \"<\\/div>\";\n+      strVar += \"<\\/div>\";\n+      strVar += \"<\\/div>\";\n+      $('.row-word-answer').append(strVar)\n+      $('#word_answer_count').val(answer_count)\n+    else\n+      alert(\"Answer 2 to 5\")","path":"app/assets/javascripts/app.coffee","position":67,"original_position":67,"commit_id":"786266e3f6c581a8ccfc3340cfc187f4ec739cce","original_commit_id":"786266e3f6c581a8ccfc3340cfc187f4ec739cce","user":{"login":"dieunb","id":2122175,"avatar_url":"https://avatars.githubusercontent.com/u/2122175?v=3","gravatar_id":"","url":"https://api.github.com/users/dieunb","html_url":"https://github.com/dieunb","followers_url":"https://api.github.com/users/dieunb/followers","following_url":"https://api.github.com/users/dieunb/following{/other_user}","gists_url":"https://api.github.com/users/dieunb/gists{/gist_id}","starred_url":"https://api.github.com/users/dieunb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieunb/subscriptions","organizations_url":"https://api.github.com/users/dieunb/orgs","repos_url":"https://api.github.com/users/dieunb/repos","events_url":"https://api.github.com/users/dieunb/events{/privacy}","received_events_url":"https://api.github.com/users/dieunb/received_events","type":"User","site_admin":false},"body":"Ý nghĩa của dòng alert này là gì?","created_at":"2016-08-02T06:35:28Z","updated_at":"2016-08-02T06:35:28Z","html_url":"https://github.com/framgia/fels_166/pull/24#discussion_r73101010","pull_request_url":"https://api.github.com/repos/framgia/fels_166/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/comments/73101010"},"html":{"href":"https://github.com/framgia/fels_166/pull/24#discussion_r73101010"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_166/pulls/24","id":79560028,"html_url":"https://github.com/framgia/fels_166/pull/24","diff_url":"https://github.com/framgia/fels_166/pull/24.diff","patch_url":"https://github.com/framgia/fels_166/pull/24.patch","issue_url":"https://api.github.com/repos/framgia/fels_166/issues/24","number":24,"state":"open","locked":false,"title":"admin edit, delete word","user":{"login":"TranVanQuy0204","id":20278708,"avatar_url":"https://avatars.githubusercontent.com/u/20278708?v=3","gravatar_id":"","url":"https://api.github.com/users/TranVanQuy0204","html_url":"https://github.com/TranVanQuy0204","followers_url":"https://api.github.com/users/TranVanQuy0204/followers","following_url":"https://api.github.com/users/TranVanQuy0204/following{/other_user}","gists_url":"https://api.github.com/users/TranVanQuy0204/gists{/gist_id}","starred_url":"https://api.github.com/users/TranVanQuy0204/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TranVanQuy0204/subscriptions","organizations_url":"https://api.github.com/users/TranVanQuy0204/orgs","repos_url":"https://api.github.com/users/TranVanQuy0204/repos","events_url":"https://api.github.com/users/TranVanQuy0204/events{/privacy}","received_events_url":"https://api.github.com/users/TranVanQuy0204/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-01T12:27:51Z","updated_at":"2016-08-02T06:35:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58ba538fff2ff951fdb30a6d34f73ac337094ccd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_166/pulls/24/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_166/pulls/24/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_166/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_166/issues/24/comments","statuses_url":"https://api.github.com/repos/framgia/fels_166/statuses/786266e3f6c581a8ccfc3340cfc187f4ec739cce","head":{"label":"TranVanQuy0204:word-edit-delete","ref":"word-edit-delete","sha":"786266e3f6c581a8ccfc3340cfc187f4ec739cce","user":{"login":"TranVanQuy0204","id":20278708,"avatar_url":"https://avatars.githubusercontent.com/u/20278708?v=3","gravatar_id":"","url":"https://api.github.com/users/TranVanQuy0204","html_url":"https://github.com/TranVanQuy0204","followers_url":"https://api.github.com/users/TranVanQuy0204/followers","following_url":"https://api.github.com/users/TranVanQuy0204/following{/other_user}","gists_url":"https://api.github.com/users/TranVanQuy0204/gists{/gist_id}","starred_url":"https://api.github.com/users/TranVanQuy0204/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TranVanQuy0204/subscriptions","organizations_url":"https://api.github.com/users/TranVanQuy0204/orgs","repos_url":"https://api.github.com/users/TranVanQuy0204/repos","events_url":"https://api.github.com/users/TranVanQuy0204/events{/privacy}","received_events_url":"https://api.github.com/users/TranVanQuy0204/received_events","type":"User","site_admin":false},"repo":{"id":63826447,"name":"fels_166","full_name":"TranVanQuy0204/fels_166","owner":{"login":"TranVanQuy0204","id":20278708,"avatar_url":"https://avatars.githubusercontent.com/u/20278708?v=3","gravatar_id":"","url":"https://api.github.com/users/TranVanQuy0204","html_url":"https://github.com/TranVanQuy0204","followers_url":"https://api.github.com/users/TranVanQuy0204/followers","following_url":"https://api.github.com/users/TranVanQuy0204/following{/other_user}","gists_url":"https://api.github.com/users/TranVanQuy0204/gists{/gist_id}","starred_url":"https://api.github.com/users/TranVanQuy0204/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TranVanQuy0204/subscriptions","organizations_url":"https://api.github.com/users/TranVanQuy0204/orgs","repos_url":"https://api.github.com/users/TranVanQuy0204/repos","events_url":"https://api.github.com/users/TranVanQuy0204/events{/privacy}","received_events_url":"https://api.github.com/users/TranVanQuy0204/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TranVanQuy0204/fels_166","description":"Framgia Elearning System (Training)","fork":true,"url":"https://api.github.com/repos/TranVanQuy0204/fels_166","forks_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/forks","keys_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/teams","hooks_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/hooks","issue_events_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/issues/events{/number}","events_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/events","assignees_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/assignees{/user}","branches_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/branches{/branch}","tags_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/tags","blobs_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/git/refs{/sha}","trees_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/statuses/{sha}","languages_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/languages","stargazers_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/stargazers","contributors_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/contributors","subscribers_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/subscribers","subscription_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/subscription","commits_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/commits{/sha}","git_commits_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/git/commits{/sha}","comments_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/comments{/number}","issue_comment_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/issues/comments{/number}","contents_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/contents/{+path}","compare_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/merges","archive_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/downloads","issues_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/issues{/number}","pulls_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/pulls{/number}","milestones_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/milestones{/number}","notifications_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/labels{/name}","releases_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/releases{/id}","deployments_url":"https://api.github.com/repos/TranVanQuy0204/fels_166/deployments","created_at":"2016-07-21T01:24:54Z","updated_at":"2016-07-20T06:21:10Z","pushed_at":"2016-08-02T06:31:04Z","git_url":"git://github.com/TranVanQuy0204/fels_166.git","ssh_url":"git@github.com:TranVanQuy0204/fels_166.git","clone_url":"https://github.com/TranVanQuy0204/fels_166.git","svn_url":"https://github.com/TranVanQuy0204/fels_166","homepage":null,"size":343,"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":"857aefff9d83d079adb1d2a7de80a338b06b79a4","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":63755793,"name":"fels_166","full_name":"framgia/fels_166","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_166","description":"Framgia Elearning System (Training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_166","forks_url":"https://api.github.com/repos/framgia/fels_166/forks","keys_url":"https://api.github.com/repos/framgia/fels_166/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_166/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_166/teams","hooks_url":"https://api.github.com/repos/framgia/fels_166/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_166/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_166/events","assignees_url":"https://api.github.com/repos/framgia/fels_166/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_166/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_166/tags","blobs_url":"https://api.github.com/repos/framgia/fels_166/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_166/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_166/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_166/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_166/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_166/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_166/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_166/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_166/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_166/subscription","commits_url":"https://api.github.com/repos/framgia/fels_166/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_166/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_166/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_166/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_166/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_166/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_166/merges","archive_url":"https://api.github.com/repos/framgia/fels_166/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_166/downloads","issues_url":"https://api.github.com/repos/framgia/fels_166/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_166/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_166/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_166/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_166/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_166/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_166/deployments","created_at":"2016-07-20T06:21:10Z","updated_at":"2016-07-20T06:21:10Z","pushed_at":"2016-08-02T06:31:04Z","git_url":"git://github.com/framgia/fels_166.git","ssh_url":"git@github.com:framgia/fels_166.git","clone_url":"https://github.com/framgia/fels_166.git","svn_url":"https://github.com/framgia/fels_166","homepage":null,"size":340,"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":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/24"},"html":{"href":"https://github.com/framgia/fels_166/pull/24"},"issue":{"href":"https://api.github.com/repos/framgia/fels_166/issues/24"},"comments":{"href":"https://api.github.com/repos/framgia/fels_166/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_166/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_166/statuses/786266e3f6c581a8ccfc3340cfc187f4ec739cce"}}}}
{"actor":{"display_login":"dieunb"}}