{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/74788627","id":74788627,"diff_hunk":"@@ -0,0 +1,247 @@\n+\"\"\"\n+Models used for robust grading.\n+\n+Robust grading allows student scores to be saved per-subsection independent\n+of any changes that may occur to the course after the score is achieved.\n+\"\"\"\n+\n+from django.db import models\n+from django.db.utils import IntegrityError\n+from model_utils.models import TimeStampedModel\n+\n+from coursewarehistoryextended.fields import UnsignedBigIntAutoField\n+from xmodule_django.models import CourseKeyField, UsageKeyField\n+\n+from base64 import b64encode\n+from collections import namedtuple\n+from hashlib import sha256\n+import json\n+import logging\n+\n+\n+log = logging.getLogger(__name__)\n+\n+\n+# Used to serialize information about a block at the time it was used in\n+# grade calculation.\n+BlockRecord = namedtuple('BlockRecord', ['locator', 'weight', 'max_score'])\n+\n+\n+def blockrecord_list_to_json(blocks):\n+    \"\"\"\n+    Return a JSON-serialized version of the list of block records.\n+    \"\"\"\n+    return json.dumps([block._asdict() for block in blocks], separators=(',', ':'), sort_keys=True)\n+\n+def blockrecord_json_to_hash(block_json):","path":"lms/djangoapps/grades/models.py","position":36,"original_position":36,"commit_id":"d7aa1f3a57ed9bf9b39106476c8e23bb4661bb2e","original_commit_id":"d7aa1f3a57ed9bf9b39106476c8e23bb4661bb2e","user":{"login":"efischer19","id":7373924,"avatar_url":"https://avatars.githubusercontent.com/u/7373924?v=3","gravatar_id":"","url":"https://api.github.com/users/efischer19","html_url":"https://github.com/efischer19","followers_url":"https://api.github.com/users/efischer19/followers","following_url":"https://api.github.com/users/efischer19/following{/other_user}","gists_url":"https://api.github.com/users/efischer19/gists{/gist_id}","starred_url":"https://api.github.com/users/efischer19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efischer19/subscriptions","organizations_url":"https://api.github.com/users/efischer19/orgs","repos_url":"https://api.github.com/users/efischer19/repos","events_url":"https://api.github.com/users/efischer19/events{/privacy}","received_events_url":"https://api.github.com/users/efischer19/received_events","type":"User","site_admin":false},"body":"I think it's a solid idea","created_at":"2016-08-15T16:24:29Z","updated_at":"2016-08-15T16:24:29Z","html_url":"https://github.com/edx/edx-platform/pull/13143#discussion_r74788627","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/13143","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/74788627"},"html":{"href":"https://github.com/edx/edx-platform/pull/13143#discussion_r74788627"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13143"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/13143","id":79626516,"html_url":"https://github.com/edx/edx-platform/pull/13143","diff_url":"https://github.com/edx/edx-platform/pull/13143.diff","patch_url":"https://github.com/edx/edx-platform/pull/13143.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/13143","number":13143,"state":"open","locked":false,"title":"Persistent Grades Data Model","user":{"login":"efischer19","id":7373924,"avatar_url":"https://avatars.githubusercontent.com/u/7373924?v=3","gravatar_id":"","url":"https://api.github.com/users/efischer19","html_url":"https://github.com/efischer19","followers_url":"https://api.github.com/users/efischer19/followers","following_url":"https://api.github.com/users/efischer19/following{/other_user}","gists_url":"https://api.github.com/users/efischer19/gists{/gist_id}","starred_url":"https://api.github.com/users/efischer19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efischer19/subscriptions","organizations_url":"https://api.github.com/users/efischer19/orgs","repos_url":"https://api.github.com/users/efischer19/repos","events_url":"https://api.github.com/users/efischer19/events{/privacy}","received_events_url":"https://api.github.com/users/efischer19/received_events","type":"User","site_admin":false},"body":"[TNL-5005](https://openedx.atlassian.net/browse/TNL-5005) Introduces database models and simple CRUD interface.\r\n\r\nReborn from the ashes of https://github.com/edx/edx-platform/pull/13094.","created_at":"2016-08-01T19:57:56Z","updated_at":"2016-08-15T16:24:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e40283f79b6b9aaf592c02d209252568b66d783c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/13143/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/13143/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/13143/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/d7aa1f3a57ed9bf9b39106476c8e23bb4661bb2e","head":{"label":"edx:efischer/grades","ref":"efischer/grades","sha":"d7aa1f3a57ed9bf9b39106476c8e23bb4661bb2e","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":"The Open edX platform, the software that powers edX!","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}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-08-15T10:25:23Z","pushed_at":"2016-08-15T16:20:21Z","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://open.edx.org/","size":807343,"stargazers_count":2723,"watchers_count":2723,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1639,"mirror_url":null,"open_issues_count":138,"forks":1639,"open_issues":138,"watchers":2723,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"30993cde62cfd45923bda6f80910a623b8b07ed7","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":"The Open edX platform, the software that powers edX!","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}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-08-15T10:25:23Z","pushed_at":"2016-08-15T16:20:21Z","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://open.edx.org/","size":807343,"stargazers_count":2723,"watchers_count":2723,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1639,"mirror_url":null,"open_issues_count":138,"forks":1639,"open_issues":138,"watchers":2723,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13143"},"html":{"href":"https://github.com/edx/edx-platform/pull/13143"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/13143"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/13143/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13143/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/13143/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/d7aa1f3a57ed9bf9b39106476c8e23bb4661bb2e"}}}}
{"actor":{"display_login":"efischer19"}}