{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/22580512","id":22580512,"diff_hunk":"@@ -67,7 +68,15 @@ def compare_with_tolerance(student_complex, instructor_complex, tolerance=defaul\n     else:\n         # v1 and v2 are, in general, complex numbers:\n         # there are some notes about backward compatibility issue: see responsetypes.get_staff_ans()).\n-        return abs(student_complex - instructor_complex) <= tolerance\n+        # Here we are rounding the abs value according to tolerance decimal count because abs function return\n+        # value which contain very small value e.g 1.23556442255112551 and is approximately equal to tolerance\n+        tolerance_round = -1\n+        if isinstance(student_complex, float):\n+            tolerance_round = Decimal(str(student_complex))._exp * -1   # pylint: disable=protected-access","path":"common/lib/capa/capa/util.py","position":17,"original_position":17,"commit_id":"2d4e6ce9aa21126aaaab860dae783c546ee3dcc9","original_commit_id":"2d4e6ce9aa21126aaaab860dae783c546ee3dcc9","user":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"body":"yes thats the main logic","created_at":"2015-01-07T10:51:43Z","updated_at":"2015-01-07T10:51:43Z","html_url":"https://github.com/edx/edx-platform/pull/6285#discussion_r22580512","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/6285","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/22580512"},"html":{"href":"https://github.com/edx/edx-platform/pull/6285#discussion_r22580512"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/6285"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/6285","id":26212148,"html_url":"https://github.com/edx/edx-platform/pull/6285","diff_url":"https://github.com/edx/edx-platform/pull/6285.diff","patch_url":"https://github.com/edx/edx-platform/pull/6285.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/6285","number":6285,"state":"open","locked":false,"title":"Fix tolerance broken","user":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"body":"TNL-904 https://openedx.atlassian.net/browse/TNL-904","created_at":"2014-12-17T09:58:50Z","updated_at":"2015-01-07T10:51:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5ea6c49b1cb1b2bb0bac837605114bed8c63340","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/6285/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/6285/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/{number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/6285/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/2d4e6ce9aa21126aaaab860dae783c546ee3dcc9","head":{"label":"Shrhawk:shr/bug/TNL-904-tolerance-is-broken","ref":"shr/bug/TNL-904-tolerance-is-broken","sha":"2d4e6ce9aa21126aaaab860dae783c546ee3dcc9","user":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"repo":{"id":25812144,"name":"edx-platform","full_name":"Shrhawk/edx-platform","owner":{"login":"Shrhawk","id":7054417,"avatar_url":"https://avatars.githubusercontent.com/u/7054417?v=3","gravatar_id":"","url":"https://api.github.com/users/Shrhawk","html_url":"https://github.com/Shrhawk","followers_url":"https://api.github.com/users/Shrhawk/followers","following_url":"https://api.github.com/users/Shrhawk/following{/other_user}","gists_url":"https://api.github.com/users/Shrhawk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shrhawk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shrhawk/subscriptions","organizations_url":"https://api.github.com/users/Shrhawk/orgs","repos_url":"https://api.github.com/users/Shrhawk/repos","events_url":"https://api.github.com/users/Shrhawk/events{/privacy}","received_events_url":"https://api.github.com/users/Shrhawk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shrhawk/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":true,"url":"https://api.github.com/repos/Shrhawk/edx-platform","forks_url":"https://api.github.com/repos/Shrhawk/edx-platform/forks","keys_url":"https://api.github.com/repos/Shrhawk/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shrhawk/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shrhawk/edx-platform/teams","hooks_url":"https://api.github.com/repos/Shrhawk/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/Shrhawk/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/Shrhawk/edx-platform/events","assignees_url":"https://api.github.com/repos/Shrhawk/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/Shrhawk/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/Shrhawk/edx-platform/tags","blobs_url":"https://api.github.com/repos/Shrhawk/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shrhawk/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shrhawk/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shrhawk/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shrhawk/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/Shrhawk/edx-platform/languages","stargazers_url":"https://api.github.com/repos/Shrhawk/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/Shrhawk/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/Shrhawk/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/Shrhawk/edx-platform/subscription","commits_url":"https://api.github.com/repos/Shrhawk/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shrhawk/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shrhawk/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shrhawk/edx-platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/Shrhawk/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/Shrhawk/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shrhawk/edx-platform/merges","archive_url":"https://api.github.com/repos/Shrhawk/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shrhawk/edx-platform/downloads","issues_url":"https://api.github.com/repos/Shrhawk/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/Shrhawk/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/Shrhawk/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/Shrhawk/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shrhawk/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/Shrhawk/edx-platform/releases{/id}","created_at":"2014-10-27T09:41:10Z","updated_at":"2015-01-05T07:41:33Z","pushed_at":"2015-01-06T14:16:44Z","git_url":"git://github.com/Shrhawk/edx-platform.git","ssh_url":"git@github.com:Shrhawk/edx-platform.git","clone_url":"https://github.com/Shrhawk/edx-platform.git","svn_url":"https://github.com/Shrhawk/edx-platform","homepage":"http://openedx.org/","size":382938,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"edx:master","ref":"master","sha":"f6186aeda48e04fa8fae3b4310f0ed31e608b535","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-01-07T10:49:30Z","pushed_at":"2015-01-07T10:49:11Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1564633,"stargazers_count":1649,"watchers_count":1649,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":947,"mirror_url":null,"open_issues_count":141,"forks":947,"open_issues":141,"watchers":1649,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/6285"},"html":{"href":"https://github.com/edx/edx-platform/pull/6285"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/6285"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/6285/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/6285/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/6285/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/2d4e6ce9aa21126aaaab860dae783c546ee3dcc9"}}}}