{"action":"created","comment":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/68911796","id":68911796,"diff_hunk":"@@ -962,22 +962,28 @@ function getWarningMessage() {\n  * @param textAreaId - Id of text area for which char are to be counted\n  * @param charCountId - Id of Label to display length of text area\n  */\n-function updateTextQuestionCharCount(textAreaId, charCountId, recommendedLength) {\n-    var cs = $('#' + textAreaId).val().trim().split(/\\s+/).length;\n-    \n-    if ($('#' + textAreaId).val().length === 0) {\n-        $('#' + charCountId).text('0');\n+function updateTextQuestionWordsCount(textAreaId, wordsCountId, recommendedLength) {\n+\t\n+    var response = $('#' + textAreaId).val();\n+    var wordsCountElement = $('#' + wordsCountId);\n+\n+    var wordsCount = response.split(/\\s/g).filter(function(item) {\n+        return item.match(/\\w/);\n+    }).length;\n+\n+    if (response.length === 0) {\n+        wordsCountElement.text('0');\n     } else {\n-        $('#' + charCountId).text(cs);\n+        wordsCountElement.text(wordsCount);\n     }\n \n     var upperLimit = recommendedLength + recommendedLength * 0.1;\n     var lowerLimit = recommendedLength - recommendedLength * 0.1;\n \n-    if ($('#' + charCountId).text() > lowerLimit\n-            && $('#' + charCountId).text() < upperLimit) {\n-        $('#' + charCountId).css('color', 'green');\n+    if (wordsCountElement.text() > lowerLimit\n+            && wordsCountElement.text() < upperLimit) {","path":"src/main/webapp/js/feedbackSubmissionsEdit.js","position":null,"original_position":46,"commit_id":"046a6966548823bb36dae4e36cc7ec2427a6147a","original_commit_id":"046a6966548823bb36dae4e36cc7ec2427a6147a","user":{"login":"JosephineKwa","id":9999077,"avatar_url":"https://avatars.githubusercontent.com/u/9999077?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephineKwa","html_url":"https://github.com/JosephineKwa","followers_url":"https://api.github.com/users/JosephineKwa/followers","following_url":"https://api.github.com/users/JosephineKwa/following{/other_user}","gists_url":"https://api.github.com/users/JosephineKwa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephineKwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephineKwa/subscriptions","organizations_url":"https://api.github.com/users/JosephineKwa/orgs","repos_url":"https://api.github.com/users/JosephineKwa/repos","events_url":"https://api.github.com/users/JosephineKwa/events{/privacy}","received_events_url":"https://api.github.com/users/JosephineKwa/received_events","type":"User","site_admin":false},"body":"Extract `wordsCountElement.text()` into a variable too","created_at":"2016-06-29T09:15:58Z","updated_at":"2016-06-29T09:15:58Z","html_url":"https://github.com/TEAMMATES/teammates/pull/5627#discussion_r68911796","pull_request_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627","_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments/68911796"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5627#discussion_r68911796"},"pull_request":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627"}}},"pull_request":{"url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627","id":73798723,"html_url":"https://github.com/TEAMMATES/teammates/pull/5627","diff_url":"https://github.com/TEAMMATES/teammates/pull/5627.diff","patch_url":"https://github.com/TEAMMATES/teammates/pull/5627.patch","issue_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5627","number":5627,"state":"open","locked":false,"title":"option to set recommended length for Essay questions #5606","user":{"login":"tarun14110","id":12219700,"avatar_url":"https://avatars.githubusercontent.com/u/12219700?v=3","gravatar_id":"","url":"https://api.github.com/users/tarun14110","html_url":"https://github.com/tarun14110","followers_url":"https://api.github.com/users/tarun14110/followers","following_url":"https://api.github.com/users/tarun14110/following{/other_user}","gists_url":"https://api.github.com/users/tarun14110/gists{/gist_id}","starred_url":"https://api.github.com/users/tarun14110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarun14110/subscriptions","organizations_url":"https://api.github.com/users/tarun14110/orgs","repos_url":"https://api.github.com/users/tarun14110/repos","events_url":"https://api.github.com/users/tarun14110/events{/privacy}","received_events_url":"https://api.github.com/users/tarun14110/received_events","type":"User","site_admin":false},"body":"Fixes #5606\r\n\r\n![screenshot from 2016-06-15 10 40 25](https://cloud.githubusercontent.com/assets/12219700/16068693/a2ea4244-32e5-11e6-839f-8f8528397ad8.png)\r\n\r\n\r\n![screenshot from 2016-06-15 10 39 24](https://cloud.githubusercontent.com/assets/12219700/16068714/ce369696-32e5-11e6-9432-a2fbeba2898a.png)\r\n","created_at":"2016-06-14T19:26:20Z","updated_at":"2016-06-29T09:15:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4cd97312219ba4ad484ea445bb48cd8804b4947","assignee":{"login":"JosephineKwa","id":9999077,"avatar_url":"https://avatars.githubusercontent.com/u/9999077?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephineKwa","html_url":"https://github.com/JosephineKwa","followers_url":"https://api.github.com/users/JosephineKwa/followers","following_url":"https://api.github.com/users/JosephineKwa/following{/other_user}","gists_url":"https://api.github.com/users/JosephineKwa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephineKwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephineKwa/subscriptions","organizations_url":"https://api.github.com/users/JosephineKwa/orgs","repos_url":"https://api.github.com/users/JosephineKwa/repos","events_url":"https://api.github.com/users/JosephineKwa/events{/privacy}","received_events_url":"https://api.github.com/users/JosephineKwa/received_events","type":"User","site_admin":false},"assignees":[{"login":"JosephineKwa","id":9999077,"avatar_url":"https://avatars.githubusercontent.com/u/9999077?v=3","gravatar_id":"","url":"https://api.github.com/users/JosephineKwa","html_url":"https://github.com/JosephineKwa","followers_url":"https://api.github.com/users/JosephineKwa/followers","following_url":"https://api.github.com/users/JosephineKwa/following{/other_user}","gists_url":"https://api.github.com/users/JosephineKwa/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephineKwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephineKwa/subscriptions","organizations_url":"https://api.github.com/users/JosephineKwa/orgs","repos_url":"https://api.github.com/users/JosephineKwa/repos","events_url":"https://api.github.com/users/JosephineKwa/events{/privacy}","received_events_url":"https://api.github.com/users/JosephineKwa/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627/commits","review_comments_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627/comments","review_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/5627/comments","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/046a6966548823bb36dae4e36cc7ec2427a6147a","head":{"label":"tarun14110:5606-Option-to-set-recommended-length-for-Text-questions","ref":"5606-Option-to-set-recommended-length-for-Text-questions","sha":"046a6966548823bb36dae4e36cc7ec2427a6147a","user":{"login":"tarun14110","id":12219700,"avatar_url":"https://avatars.githubusercontent.com/u/12219700?v=3","gravatar_id":"","url":"https://api.github.com/users/tarun14110","html_url":"https://github.com/tarun14110","followers_url":"https://api.github.com/users/tarun14110/followers","following_url":"https://api.github.com/users/tarun14110/following{/other_user}","gists_url":"https://api.github.com/users/tarun14110/gists{/gist_id}","starred_url":"https://api.github.com/users/tarun14110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarun14110/subscriptions","organizations_url":"https://api.github.com/users/tarun14110/orgs","repos_url":"https://api.github.com/users/tarun14110/repos","events_url":"https://api.github.com/users/tarun14110/events{/privacy}","received_events_url":"https://api.github.com/users/tarun14110/received_events","type":"User","site_admin":false},"repo":{"id":50403495,"name":"repo","full_name":"tarun14110/repo","owner":{"login":"tarun14110","id":12219700,"avatar_url":"https://avatars.githubusercontent.com/u/12219700?v=3","gravatar_id":"","url":"https://api.github.com/users/tarun14110","html_url":"https://github.com/tarun14110","followers_url":"https://api.github.com/users/tarun14110/followers","following_url":"https://api.github.com/users/tarun14110/following{/other_user}","gists_url":"https://api.github.com/users/tarun14110/gists{/gist_id}","starred_url":"https://api.github.com/users/tarun14110/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarun14110/subscriptions","organizations_url":"https://api.github.com/users/tarun14110/orgs","repos_url":"https://api.github.com/users/tarun14110/repos","events_url":"https://api.github.com/users/tarun14110/events{/privacy}","received_events_url":"https://api.github.com/users/tarun14110/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tarun14110/repo","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":true,"url":"https://api.github.com/repos/tarun14110/repo","forks_url":"https://api.github.com/repos/tarun14110/repo/forks","keys_url":"https://api.github.com/repos/tarun14110/repo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tarun14110/repo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tarun14110/repo/teams","hooks_url":"https://api.github.com/repos/tarun14110/repo/hooks","issue_events_url":"https://api.github.com/repos/tarun14110/repo/issues/events{/number}","events_url":"https://api.github.com/repos/tarun14110/repo/events","assignees_url":"https://api.github.com/repos/tarun14110/repo/assignees{/user}","branches_url":"https://api.github.com/repos/tarun14110/repo/branches{/branch}","tags_url":"https://api.github.com/repos/tarun14110/repo/tags","blobs_url":"https://api.github.com/repos/tarun14110/repo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tarun14110/repo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tarun14110/repo/git/refs{/sha}","trees_url":"https://api.github.com/repos/tarun14110/repo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tarun14110/repo/statuses/{sha}","languages_url":"https://api.github.com/repos/tarun14110/repo/languages","stargazers_url":"https://api.github.com/repos/tarun14110/repo/stargazers","contributors_url":"https://api.github.com/repos/tarun14110/repo/contributors","subscribers_url":"https://api.github.com/repos/tarun14110/repo/subscribers","subscription_url":"https://api.github.com/repos/tarun14110/repo/subscription","commits_url":"https://api.github.com/repos/tarun14110/repo/commits{/sha}","git_commits_url":"https://api.github.com/repos/tarun14110/repo/git/commits{/sha}","comments_url":"https://api.github.com/repos/tarun14110/repo/comments{/number}","issue_comment_url":"https://api.github.com/repos/tarun14110/repo/issues/comments{/number}","contents_url":"https://api.github.com/repos/tarun14110/repo/contents/{+path}","compare_url":"https://api.github.com/repos/tarun14110/repo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tarun14110/repo/merges","archive_url":"https://api.github.com/repos/tarun14110/repo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tarun14110/repo/downloads","issues_url":"https://api.github.com/repos/tarun14110/repo/issues{/number}","pulls_url":"https://api.github.com/repos/tarun14110/repo/pulls{/number}","milestones_url":"https://api.github.com/repos/tarun14110/repo/milestones{/number}","notifications_url":"https://api.github.com/repos/tarun14110/repo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tarun14110/repo/labels{/name}","releases_url":"https://api.github.com/repos/tarun14110/repo/releases{/id}","deployments_url":"https://api.github.com/repos/tarun14110/repo/deployments","created_at":"2016-01-26T04:34:41Z","updated_at":"2016-01-26T04:34:47Z","pushed_at":"2016-06-28T11:57:32Z","git_url":"git://github.com/tarun14110/repo.git","ssh_url":"git@github.com:tarun14110/repo.git","clone_url":"https://github.com/tarun14110/repo.git","svn_url":"https://github.com/tarun14110/repo","homepage":"http://teammatesv4.appspot.com/","size":163288,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":"TEAMMATES:master","ref":"master","sha":"fec0b5683ccc1940f4c84b45fd007548d8146e5a","user":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"repo":{"id":19369035,"name":"teammates","full_name":"TEAMMATES/teammates","owner":{"login":"TEAMMATES","id":7374810,"avatar_url":"https://avatars.githubusercontent.com/u/7374810?v=3","gravatar_id":"","url":"https://api.github.com/users/TEAMMATES","html_url":"https://github.com/TEAMMATES","followers_url":"https://api.github.com/users/TEAMMATES/followers","following_url":"https://api.github.com/users/TEAMMATES/following{/other_user}","gists_url":"https://api.github.com/users/TEAMMATES/gists{/gist_id}","starred_url":"https://api.github.com/users/TEAMMATES/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TEAMMATES/subscriptions","organizations_url":"https://api.github.com/users/TEAMMATES/orgs","repos_url":"https://api.github.com/users/TEAMMATES/repos","events_url":"https://api.github.com/users/TEAMMATES/events{/privacy}","received_events_url":"https://api.github.com/users/TEAMMATES/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TEAMMATES/teammates","description":"This is the project website for the TEAMMATES feedback management tool for education","fork":false,"url":"https://api.github.com/repos/TEAMMATES/teammates","forks_url":"https://api.github.com/repos/TEAMMATES/teammates/forks","keys_url":"https://api.github.com/repos/TEAMMATES/teammates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TEAMMATES/teammates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TEAMMATES/teammates/teams","hooks_url":"https://api.github.com/repos/TEAMMATES/teammates/hooks","issue_events_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/events{/number}","events_url":"https://api.github.com/repos/TEAMMATES/teammates/events","assignees_url":"https://api.github.com/repos/TEAMMATES/teammates/assignees{/user}","branches_url":"https://api.github.com/repos/TEAMMATES/teammates/branches{/branch}","tags_url":"https://api.github.com/repos/TEAMMATES/teammates/tags","blobs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TEAMMATES/teammates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TEAMMATES/teammates/git/refs{/sha}","trees_url":"https://api.github.com/repos/TEAMMATES/teammates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TEAMMATES/teammates/statuses/{sha}","languages_url":"https://api.github.com/repos/TEAMMATES/teammates/languages","stargazers_url":"https://api.github.com/repos/TEAMMATES/teammates/stargazers","contributors_url":"https://api.github.com/repos/TEAMMATES/teammates/contributors","subscribers_url":"https://api.github.com/repos/TEAMMATES/teammates/subscribers","subscription_url":"https://api.github.com/repos/TEAMMATES/teammates/subscription","commits_url":"https://api.github.com/repos/TEAMMATES/teammates/commits{/sha}","git_commits_url":"https://api.github.com/repos/TEAMMATES/teammates/git/commits{/sha}","comments_url":"https://api.github.com/repos/TEAMMATES/teammates/comments{/number}","issue_comment_url":"https://api.github.com/repos/TEAMMATES/teammates/issues/comments{/number}","contents_url":"https://api.github.com/repos/TEAMMATES/teammates/contents/{+path}","compare_url":"https://api.github.com/repos/TEAMMATES/teammates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TEAMMATES/teammates/merges","archive_url":"https://api.github.com/repos/TEAMMATES/teammates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TEAMMATES/teammates/downloads","issues_url":"https://api.github.com/repos/TEAMMATES/teammates/issues{/number}","pulls_url":"https://api.github.com/repos/TEAMMATES/teammates/pulls{/number}","milestones_url":"https://api.github.com/repos/TEAMMATES/teammates/milestones{/number}","notifications_url":"https://api.github.com/repos/TEAMMATES/teammates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TEAMMATES/teammates/labels{/name}","releases_url":"https://api.github.com/repos/TEAMMATES/teammates/releases{/id}","deployments_url":"https://api.github.com/repos/TEAMMATES/teammates/deployments","created_at":"2014-05-02T07:43:00Z","updated_at":"2016-06-22T14:10:56Z","pushed_at":"2016-06-29T08:10:53Z","git_url":"git://github.com/TEAMMATES/teammates.git","ssh_url":"git@github.com:TEAMMATES/teammates.git","clone_url":"https://github.com/TEAMMATES/teammates.git","svn_url":"https://github.com/TEAMMATES/teammates","homepage":"http://teammatesv4.appspot.com/","size":186539,"stargazers_count":98,"watchers_count":98,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":254,"mirror_url":null,"open_issues_count":496,"forks":254,"open_issues":496,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627"},"html":{"href":"https://github.com/TEAMMATES/teammates/pull/5627"},"issue":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5627"},"comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/issues/5627/comments"},"review_comments":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627/comments"},"review_comment":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TEAMMATES/teammates/pulls/5627/commits"},"statuses":{"href":"https://api.github.com/repos/TEAMMATES/teammates/statuses/046a6966548823bb36dae4e36cc7ec2427a6147a"}}}}
{"actor":{"display_login":"JosephineKwa"}}