{"action":"created","comment":{"url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/comments/42492808","id":42492808,"diff_hunk":"@@ -0,0 +1,46 @@\n+var _ = require('lodash');\n+var React = require('react');\n+\n+module.exports = React.createClass({\n+    render: function() {\n+        if (this.props.score=='')\n+          return <div>未採点</div>;\n+\n+        var answers = this.props.score==''?{}:JSON.parse(this.props.score.replace(/=>/g, ': '));\n+        var e = this.props.exercises;\n+\n+        var required_e = _.filter(e, function (a) { var info = a[1]; return info.required; });\n+        var cnt_required = _.filter(required_e, function(a) { var name = a[0]; return answers[name]; }).length;\n+        var required = <div>必修: {cnt_required}/{required_e.length}</div>\n+        \n+        var max_level = _.chain(e)\n+                         .map(function (a) {\n+                            var info = a[1];\n+                            return _.isUndefined(info.level)?0:info.level;\n+                         }).max().value();\n+        var iii = _.map(e, function (a) {\n+                      var info = a[1];\n+                      return _.isUndefined(info.level)?0:info.level;\n+                   });\n+        var levels = (_.isUndefined(max_level) || max_level == 0)?[ <div /> ]:new Array(max_level);\n+        for (i = 1; i <= max_level; i++) {\n+          level_i_e = _.filter(e, function(a) { var info = a[1]; return info.level ==  i; });","path":"js/record/score_status.js","position":27,"original_position":27,"commit_id":"cf4566631b3c71488992194e1412307751b3e500","original_commit_id":"cf4566631b3c71488992194e1412307751b3e500","user":{"login":"skymountain","id":338200,"avatar_url":"https://avatars.githubusercontent.com/u/338200?v=3","gravatar_id":"","url":"https://api.github.com/users/skymountain","html_url":"https://github.com/skymountain","followers_url":"https://api.github.com/users/skymountain/followers","following_url":"https://api.github.com/users/skymountain/following{/other_user}","gists_url":"https://api.github.com/users/skymountain/gists{/gist_id}","starred_url":"https://api.github.com/users/skymountain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skymountain/subscriptions","organizations_url":"https://api.github.com/users/skymountain/orgs","repos_url":"https://api.github.com/users/skymountain/repos","events_url":"https://api.github.com/users/skymountain/events{/privacy}","received_events_url":"https://api.github.com/users/skymountain/received_events","type":"User","site_admin":false},"body":"var を付けましょう","created_at":"2015-10-20T13:14:47Z","updated_at":"2015-10-20T13:14:47Z","html_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404#discussion_r42492808","pull_request_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404","_links":{"self":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/comments/42492808"},"html":{"href":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404#discussion_r42492808"},"pull_request":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404"}}},"pull_request":{"url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404","id":48063236,"html_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404","diff_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404.diff","patch_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404.patch","issue_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/404","number":404,"state":"open","locked":false,"title":"Implement scoring feature.","user":{"login":"yf-fyf","id":11085749,"avatar_url":"https://avatars.githubusercontent.com/u/11085749?v=3","gravatar_id":"","url":"https://api.github.com/users/yf-fyf","html_url":"https://github.com/yf-fyf","followers_url":"https://api.github.com/users/yf-fyf/followers","following_url":"https://api.github.com/users/yf-fyf/following{/other_user}","gists_url":"https://api.github.com/users/yf-fyf/gists{/gist_id}","starred_url":"https://api.github.com/users/yf-fyf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yf-fyf/subscriptions","organizations_url":"https://api.github.com/users/yf-fyf/orgs","repos_url":"https://api.github.com/users/yf-fyf/repos","events_url":"https://api.github.com/users/yf-fyf/events{/privacy}","received_events_url":"https://api.github.com/users/yf-fyf/received_events","type":"User","site_admin":false},"body":"### 採点機能の実装\r\n* 「採点」タブの追加．各課題を解けたか否かでチェックマークを付ける．\r\n* 「採点」タブでは，自動テストとの同期が可能．\r\n* 一覧で「必修: 3/7，星1: 2/4，星2: 3/5, その他: 0/10」など，採点状況を表示．\r\n\r\n### 内部実装\r\n* 現状，lib/score.rbが採点情報をRubyのハッシュデータを文字列化したものとして保存．\r\n(今は解けたか解けていないかの二択のみなので，ハッシュデータに使っているのはtrue, falseだけだが，拡張はRuby側でハッシュを拡張するだけで良い)\r\n* 保存に関してはコメント機能とほぼ同様で，スコア用にテキストデータをdb/kadai/../usernameにscoreフォルダを用意してそこに保存．\r\n","created_at":"2015-10-19T12:12:16Z","updated_at":"2015-10-20T13:14:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"017fd176bb19475d880d2f4284d20bc56b26ad37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404/commits","review_comments_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404/comments","review_comment_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/404/comments","statuses_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/statuses/cf4566631b3c71488992194e1412307751b3e500","head":{"label":"yf-fyf:score","ref":"score","sha":"cf4566631b3c71488992194e1412307751b3e500","user":{"login":"yf-fyf","id":11085749,"avatar_url":"https://avatars.githubusercontent.com/u/11085749?v=3","gravatar_id":"","url":"https://api.github.com/users/yf-fyf","html_url":"https://github.com/yf-fyf","followers_url":"https://api.github.com/users/yf-fyf/followers","following_url":"https://api.github.com/users/yf-fyf/following{/other_user}","gists_url":"https://api.github.com/users/yf-fyf/gists{/gist_id}","starred_url":"https://api.github.com/users/yf-fyf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yf-fyf/subscriptions","organizations_url":"https://api.github.com/users/yf-fyf/orgs","repos_url":"https://api.github.com/users/yf-fyf/repos","events_url":"https://api.github.com/users/yf-fyf/events{/privacy}","received_events_url":"https://api.github.com/users/yf-fyf/received_events","type":"User","site_admin":false},"repo":{"id":31060053,"name":"automata","full_name":"yf-fyf/automata","owner":{"login":"yf-fyf","id":11085749,"avatar_url":"https://avatars.githubusercontent.com/u/11085749?v=3","gravatar_id":"","url":"https://api.github.com/users/yf-fyf","html_url":"https://github.com/yf-fyf","followers_url":"https://api.github.com/users/yf-fyf/followers","following_url":"https://api.github.com/users/yf-fyf/following{/other_user}","gists_url":"https://api.github.com/users/yf-fyf/gists{/gist_id}","starred_url":"https://api.github.com/users/yf-fyf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yf-fyf/subscriptions","organizations_url":"https://api.github.com/users/yf-fyf/orgs","repos_url":"https://api.github.com/users/yf-fyf/repos","events_url":"https://api.github.com/users/yf-fyf/events{/privacy}","received_events_url":"https://api.github.com/users/yf-fyf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yf-fyf/automata","description":null,"fork":true,"url":"https://api.github.com/repos/yf-fyf/automata","forks_url":"https://api.github.com/repos/yf-fyf/automata/forks","keys_url":"https://api.github.com/repos/yf-fyf/automata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yf-fyf/automata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yf-fyf/automata/teams","hooks_url":"https://api.github.com/repos/yf-fyf/automata/hooks","issue_events_url":"https://api.github.com/repos/yf-fyf/automata/issues/events{/number}","events_url":"https://api.github.com/repos/yf-fyf/automata/events","assignees_url":"https://api.github.com/repos/yf-fyf/automata/assignees{/user}","branches_url":"https://api.github.com/repos/yf-fyf/automata/branches{/branch}","tags_url":"https://api.github.com/repos/yf-fyf/automata/tags","blobs_url":"https://api.github.com/repos/yf-fyf/automata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yf-fyf/automata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yf-fyf/automata/git/refs{/sha}","trees_url":"https://api.github.com/repos/yf-fyf/automata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yf-fyf/automata/statuses/{sha}","languages_url":"https://api.github.com/repos/yf-fyf/automata/languages","stargazers_url":"https://api.github.com/repos/yf-fyf/automata/stargazers","contributors_url":"https://api.github.com/repos/yf-fyf/automata/contributors","subscribers_url":"https://api.github.com/repos/yf-fyf/automata/subscribers","subscription_url":"https://api.github.com/repos/yf-fyf/automata/subscription","commits_url":"https://api.github.com/repos/yf-fyf/automata/commits{/sha}","git_commits_url":"https://api.github.com/repos/yf-fyf/automata/git/commits{/sha}","comments_url":"https://api.github.com/repos/yf-fyf/automata/comments{/number}","issue_comment_url":"https://api.github.com/repos/yf-fyf/automata/issues/comments{/number}","contents_url":"https://api.github.com/repos/yf-fyf/automata/contents/{+path}","compare_url":"https://api.github.com/repos/yf-fyf/automata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yf-fyf/automata/merges","archive_url":"https://api.github.com/repos/yf-fyf/automata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yf-fyf/automata/downloads","issues_url":"https://api.github.com/repos/yf-fyf/automata/issues{/number}","pulls_url":"https://api.github.com/repos/yf-fyf/automata/pulls{/number}","milestones_url":"https://api.github.com/repos/yf-fyf/automata/milestones{/number}","notifications_url":"https://api.github.com/repos/yf-fyf/automata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yf-fyf/automata/labels{/name}","releases_url":"https://api.github.com/repos/yf-fyf/automata/releases{/id}","created_at":"2015-02-20T10:24:47Z","updated_at":"2015-10-16T14:00:49Z","pushed_at":"2015-10-19T12:01:50Z","git_url":"git://github.com/yf-fyf/automata.git","ssh_url":"git@github.com:yf-fyf/automata.git","clone_url":"https://github.com/yf-fyf/automata.git","svn_url":"https://github.com/yf-fyf/automata","homepage":null,"size":2323,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SoftwareFoundationGroupAtKyotoU:master","ref":"master","sha":"18f25d84952e77905fdb4b1aa22bd5d1d1b005b1","user":{"login":"SoftwareFoundationGroupAtKyotoU","id":9034238,"avatar_url":"https://avatars.githubusercontent.com/u/9034238?v=3","gravatar_id":"","url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU","html_url":"https://github.com/SoftwareFoundationGroupAtKyotoU","followers_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/followers","following_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/following{/other_user}","gists_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/gists{/gist_id}","starred_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/subscriptions","organizations_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/orgs","repos_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/repos","events_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/events{/privacy}","received_events_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/received_events","type":"Organization","site_admin":false},"repo":{"id":3335051,"name":"automata","full_name":"SoftwareFoundationGroupAtKyotoU/automata","owner":{"login":"SoftwareFoundationGroupAtKyotoU","id":9034238,"avatar_url":"https://avatars.githubusercontent.com/u/9034238?v=3","gravatar_id":"","url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU","html_url":"https://github.com/SoftwareFoundationGroupAtKyotoU","followers_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/followers","following_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/following{/other_user}","gists_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/gists{/gist_id}","starred_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/subscriptions","organizations_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/orgs","repos_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/repos","events_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/events{/privacy}","received_events_url":"https://api.github.com/users/SoftwareFoundationGroupAtKyotoU/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata","description":null,"fork":false,"url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata","forks_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/forks","keys_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/teams","hooks_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/hooks","issue_events_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/events{/number}","events_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/events","assignees_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/assignees{/user}","branches_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/branches{/branch}","tags_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/tags","blobs_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/git/refs{/sha}","trees_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/statuses/{sha}","languages_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/languages","stargazers_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/stargazers","contributors_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/contributors","subscribers_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/subscribers","subscription_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/subscription","commits_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/commits{/sha}","git_commits_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/git/commits{/sha}","comments_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/comments{/number}","issue_comment_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/comments{/number}","contents_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/contents/{+path}","compare_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/merges","archive_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/downloads","issues_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues{/number}","pulls_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls{/number}","milestones_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/milestones{/number}","notifications_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/labels{/name}","releases_url":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/releases{/id}","created_at":"2012-02-02T13:48:27Z","updated_at":"2015-09-12T09:34:30Z","pushed_at":"2015-10-20T05:02:19Z","git_url":"git://github.com/SoftwareFoundationGroupAtKyotoU/automata.git","ssh_url":"git@github.com:SoftwareFoundationGroupAtKyotoU/automata.git","clone_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata.git","svn_url":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata","homepage":null,"size":4091,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":46,"forks":9,"open_issues":46,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404"},"html":{"href":"https://github.com/SoftwareFoundationGroupAtKyotoU/automata/pull/404"},"issue":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/404"},"comments":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/issues/404/comments"},"review_comments":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404/comments"},"review_comment":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/pulls/404/commits"},"statuses":{"href":"https://api.github.com/repos/SoftwareFoundationGroupAtKyotoU/automata/statuses/cf4566631b3c71488992194e1412307751b3e500"}}}}