{"action":"created","comment":{"url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/comments/202947584","pull_request_review_id":137737916,"id":202947584,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjk0NzU4NA==","diff_hunk":"@@ -118,6 +134,45 @@ def submission_status(status):\n     return Submission.STATUS[status]\n \n \n+\"\"\"\n+    Used for adding relevant classes to the\n+    points_badge to enable textual status.\n+\"\"\"\n+@register.simple_tag(takes_context=True)\n+def get_points_class(context):\n+    html_class = set()\n+    if context['difficulty'] == \"-\" and context['max'] <= 2:\n+        html_class.add(\"aplus-points\")\n+        class_name = \"\"\n+\n+        if ((context['max'] == 2 and context['points'] == 2)\n+        or context['max'] == 1 and context['points']== 1):\n+            class_name = \"accepted\"\n+        elif (context['max'] == 2 and context['points'] == 1):\n+            class_name = \"ok\"\n+        elif context['points'] == 0 and context['submitted']:\n+            class_name = \"rejected\"\n+\n+        html_class.add(class_name)\n+        context['class'] = class_name","path":"exercise/templatetags/exercise.py","position":58,"original_position":58,"commit_id":"f2a08298d4d3423705e8bbbfde131fafae03126d","original_commit_id":"264368f0347215100f2b1ffdb5df45284bd9479a","user":{"login":"raphendyr","id":2327687,"node_id":"MDQ6VXNlcjIzMjc2ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/2327687?v=4","gravatar_id":"","url":"https://api.github.com/users/raphendyr","html_url":"https://github.com/raphendyr","followers_url":"https://api.github.com/users/raphendyr/followers","following_url":"https://api.github.com/users/raphendyr/following{/other_user}","gists_url":"https://api.github.com/users/raphendyr/gists{/gist_id}","starred_url":"https://api.github.com/users/raphendyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphendyr/subscriptions","organizations_url":"https://api.github.com/users/raphendyr/orgs","repos_url":"https://api.github.com/users/raphendyr/repos","events_url":"https://api.github.com/users/raphendyr/events{/privacy}","received_events_url":"https://api.github.com/users/raphendyr/received_events","type":"User","site_admin":false},"body":"It can be refactored when needed, so it's ok for now.","created_at":"2018-07-17T09:09:44Z","updated_at":"2018-07-17T09:09:45Z","html_url":"https://github.com/Aalto-LeTech/a-plus/pull/349#discussion_r202947584","pull_request_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/comments/202947584"},"html":{"href":"https://github.com/Aalto-LeTech/a-plus/pull/349#discussion_r202947584"},"pull_request":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349"}},"in_reply_to_id":202929305},"pull_request":{"url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349","id":200372329,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMzcyMzI5","html_url":"https://github.com/Aalto-LeTech/a-plus/pull/349","diff_url":"https://github.com/Aalto-LeTech/a-plus/pull/349.diff","patch_url":"https://github.com/Aalto-LeTech/a-plus/pull/349.patch","issue_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/349","number":349,"state":"open","locked":false,"title":"Exercise verbal status","user":{"login":"evnurm","id":23477304,"node_id":"MDQ6VXNlcjIzNDc3MzA0","avatar_url":"https://avatars1.githubusercontent.com/u/23477304?v=4","gravatar_id":"","url":"https://api.github.com/users/evnurm","html_url":"https://github.com/evnurm","followers_url":"https://api.github.com/users/evnurm/followers","following_url":"https://api.github.com/users/evnurm/following{/other_user}","gists_url":"https://api.github.com/users/evnurm/gists{/gist_id}","starred_url":"https://api.github.com/users/evnurm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evnurm/subscriptions","organizations_url":"https://api.github.com/users/evnurm/orgs","repos_url":"https://api.github.com/users/evnurm/repos","events_url":"https://api.github.com/users/evnurm/events{/privacy}","received_events_url":"https://api.github.com/users/evnurm/received_events","type":"User","site_admin":false},"body":"Exercise/submission status is displayed in a textual form if difficulty == \"-\" and maximum points for the exercise <= 2. Otherwise points are displayed normally. The text to be displayed in the badge is chosen with the following principle:\r\n\r\nif max-points == 2, the text is either \"Accepted/Hyväksytty\" (2), \"OK\" (1) or \"Failed/Hylätty\" (0 and a submission has been made) based on the number of points received. If max-points == 1, the texts are \"Accepted\" or \"Failed\". In the case that no submissions have been made, the status states \"Missing/Puuttuu\".","created_at":"2018-07-10T12:01:03Z","updated_at":"2018-07-17T09:09:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c2c0b463fc88a4b7e8dbeeb3180a68b88018d39","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349/commits","review_comments_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349/comments","review_comment_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/349/comments","statuses_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/statuses/f2a08298d4d3423705e8bbbfde131fafae03126d","head":{"label":"evnurm:exercise-verbal-status","ref":"exercise-verbal-status","sha":"f2a08298d4d3423705e8bbbfde131fafae03126d","user":{"login":"evnurm","id":23477304,"node_id":"MDQ6VXNlcjIzNDc3MzA0","avatar_url":"https://avatars1.githubusercontent.com/u/23477304?v=4","gravatar_id":"","url":"https://api.github.com/users/evnurm","html_url":"https://github.com/evnurm","followers_url":"https://api.github.com/users/evnurm/followers","following_url":"https://api.github.com/users/evnurm/following{/other_user}","gists_url":"https://api.github.com/users/evnurm/gists{/gist_id}","starred_url":"https://api.github.com/users/evnurm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evnurm/subscriptions","organizations_url":"https://api.github.com/users/evnurm/orgs","repos_url":"https://api.github.com/users/evnurm/repos","events_url":"https://api.github.com/users/evnurm/events{/privacy}","received_events_url":"https://api.github.com/users/evnurm/received_events","type":"User","site_admin":false},"repo":{"id":139004518,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMDQ1MTg=","name":"a-plus","full_name":"evnurm/a-plus","owner":{"login":"evnurm","id":23477304,"node_id":"MDQ6VXNlcjIzNDc3MzA0","avatar_url":"https://avatars1.githubusercontent.com/u/23477304?v=4","gravatar_id":"","url":"https://api.github.com/users/evnurm","html_url":"https://github.com/evnurm","followers_url":"https://api.github.com/users/evnurm/followers","following_url":"https://api.github.com/users/evnurm/following{/other_user}","gists_url":"https://api.github.com/users/evnurm/gists{/gist_id}","starred_url":"https://api.github.com/users/evnurm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evnurm/subscriptions","organizations_url":"https://api.github.com/users/evnurm/orgs","repos_url":"https://api.github.com/users/evnurm/repos","events_url":"https://api.github.com/users/evnurm/events{/privacy}","received_events_url":"https://api.github.com/users/evnurm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evnurm/a-plus","description":null,"fork":true,"url":"https://api.github.com/repos/evnurm/a-plus","forks_url":"https://api.github.com/repos/evnurm/a-plus/forks","keys_url":"https://api.github.com/repos/evnurm/a-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evnurm/a-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evnurm/a-plus/teams","hooks_url":"https://api.github.com/repos/evnurm/a-plus/hooks","issue_events_url":"https://api.github.com/repos/evnurm/a-plus/issues/events{/number}","events_url":"https://api.github.com/repos/evnurm/a-plus/events","assignees_url":"https://api.github.com/repos/evnurm/a-plus/assignees{/user}","branches_url":"https://api.github.com/repos/evnurm/a-plus/branches{/branch}","tags_url":"https://api.github.com/repos/evnurm/a-plus/tags","blobs_url":"https://api.github.com/repos/evnurm/a-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evnurm/a-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evnurm/a-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/evnurm/a-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evnurm/a-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/evnurm/a-plus/languages","stargazers_url":"https://api.github.com/repos/evnurm/a-plus/stargazers","contributors_url":"https://api.github.com/repos/evnurm/a-plus/contributors","subscribers_url":"https://api.github.com/repos/evnurm/a-plus/subscribers","subscription_url":"https://api.github.com/repos/evnurm/a-plus/subscription","commits_url":"https://api.github.com/repos/evnurm/a-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/evnurm/a-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/evnurm/a-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/evnurm/a-plus/issues/comments{/number}","contents_url":"https://api.github.com/repos/evnurm/a-plus/contents/{+path}","compare_url":"https://api.github.com/repos/evnurm/a-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evnurm/a-plus/merges","archive_url":"https://api.github.com/repos/evnurm/a-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evnurm/a-plus/downloads","issues_url":"https://api.github.com/repos/evnurm/a-plus/issues{/number}","pulls_url":"https://api.github.com/repos/evnurm/a-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/evnurm/a-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/evnurm/a-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evnurm/a-plus/labels{/name}","releases_url":"https://api.github.com/repos/evnurm/a-plus/releases{/id}","deployments_url":"https://api.github.com/repos/evnurm/a-plus/deployments","created_at":"2018-06-28T10:39:47Z","updated_at":"2018-06-28T10:39:49Z","pushed_at":"2018-07-17T08:08:16Z","git_url":"git://github.com/evnurm/a-plus.git","ssh_url":"git@github.com:evnurm/a-plus.git","clone_url":"https://github.com/evnurm/a-plus.git","svn_url":"https://github.com/evnurm/a-plus","homepage":null,"size":7074,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Aalto-LeTech:master","ref":"master","sha":"adeda6c76781001ef5c1cf7a3c529a68b45e6cac","user":{"login":"Aalto-LeTech","id":3787847,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3ODc4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/3787847?v=4","gravatar_id":"","url":"https://api.github.com/users/Aalto-LeTech","html_url":"https://github.com/Aalto-LeTech","followers_url":"https://api.github.com/users/Aalto-LeTech/followers","following_url":"https://api.github.com/users/Aalto-LeTech/following{/other_user}","gists_url":"https://api.github.com/users/Aalto-LeTech/gists{/gist_id}","starred_url":"https://api.github.com/users/Aalto-LeTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aalto-LeTech/subscriptions","organizations_url":"https://api.github.com/users/Aalto-LeTech/orgs","repos_url":"https://api.github.com/users/Aalto-LeTech/repos","events_url":"https://api.github.com/users/Aalto-LeTech/events{/privacy}","received_events_url":"https://api.github.com/users/Aalto-LeTech/received_events","type":"Organization","site_admin":false},"repo":{"id":5931298,"node_id":"MDEwOlJlcG9zaXRvcnk1OTMxMjk4","name":"a-plus","full_name":"Aalto-LeTech/a-plus","owner":{"login":"Aalto-LeTech","id":3787847,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3ODc4NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/3787847?v=4","gravatar_id":"","url":"https://api.github.com/users/Aalto-LeTech","html_url":"https://github.com/Aalto-LeTech","followers_url":"https://api.github.com/users/Aalto-LeTech/followers","following_url":"https://api.github.com/users/Aalto-LeTech/following{/other_user}","gists_url":"https://api.github.com/users/Aalto-LeTech/gists{/gist_id}","starred_url":"https://api.github.com/users/Aalto-LeTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aalto-LeTech/subscriptions","organizations_url":"https://api.github.com/users/Aalto-LeTech/orgs","repos_url":"https://api.github.com/users/Aalto-LeTech/repos","events_url":"https://api.github.com/users/Aalto-LeTech/events{/privacy}","received_events_url":"https://api.github.com/users/Aalto-LeTech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Aalto-LeTech/a-plus","description":null,"fork":false,"url":"https://api.github.com/repos/Aalto-LeTech/a-plus","forks_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/forks","keys_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/teams","hooks_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/hooks","issue_events_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/events{/number}","events_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/events","assignees_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/assignees{/user}","branches_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/branches{/branch}","tags_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/tags","blobs_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/languages","stargazers_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/stargazers","contributors_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/contributors","subscribers_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/subscribers","subscription_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/subscription","commits_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/contents/{+path}","compare_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/merges","archive_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/downloads","issues_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues{/number}","pulls_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/labels{/name}","releases_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/releases{/id}","deployments_url":"https://api.github.com/repos/Aalto-LeTech/a-plus/deployments","created_at":"2012-09-24T07:42:30Z","updated_at":"2018-07-16T11:18:24Z","pushed_at":"2018-07-17T08:08:18Z","git_url":"git://github.com/Aalto-LeTech/a-plus.git","ssh_url":"git@github.com:Aalto-LeTech/a-plus.git","clone_url":"https://github.com/Aalto-LeTech/a-plus.git","svn_url":"https://github.com/Aalto-LeTech/a-plus","homepage":null,"size":7193,"stargazers_count":23,"watchers_count":23,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":34,"open_issues":33,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349"},"html":{"href":"https://github.com/Aalto-LeTech/a-plus/pull/349"},"issue":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/349"},"comments":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/issues/349/comments"},"review_comments":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349/comments"},"review_comment":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/pulls/349/commits"},"statuses":{"href":"https://api.github.com/repos/Aalto-LeTech/a-plus/statuses/f2a08298d4d3423705e8bbbfde131fafae03126d"}},"author_association":"NONE"}}
{"actor":{"display_login":"raphendyr"}}