{"action":"created","comment":{"url":"https://api.github.com/repos/instructure/canvas-lms/pulls/comments/70262317","id":70262317,"diff_hunk":"@@ -482,6 +498,268 @@ def turnitinable_by_lti?\n     turnitin_data.select{|_, v| v.is_a?(Hash) && v.key?(:outcome_response)}.any?\n   end\n \n+  # VeriCite\n+\n+  # this function will check if the score needs to be updated and update/save the new score if so,\n+  # otherwise, it just returns the vericite_data_hash\n+  def vericite_data()\n+    self.vericite_data_hash ||= {}\n+    self.vericite_data_hash[:provider] = :vericite\n+    # check to see if the score is stale, if so, fetch it again\n+    updateScores = false\n+    # since there could be multiple versions, let's not waste calls for old versions and use the old score\n+    if !self.readonly? && self.versions.current.number == self.version_number\n+      self.vericite_data_hash.keys.each do |asset_string|\n+        data = self.vericite_data_hash[asset_string]\n+        next unless data && data.is_a?(Hash) && data[:object_id]\n+        updateScores = updateScores || vericite_recheck_score(data)\n+      end\n+      # we have found at least one score that is stale, call VeriCite and save the results\n+      if updateScores\n+        check_vericite_status\n+      end\n+    end\n+    self.vericite_data_hash\n+  end\n+\n+  def vericite_data_hash\n+    # use the same backend structure to store \"content review\" data\n+    self.turnitin_data\n+  end\n+\n+  # this function looks at a vericite data object and determines whether the score needs to be rechecked (i.e. cache for 20 mins)","path":"app/models/submission.rb","position":88,"original_position":88,"commit_id":"e3a86290b18b7a7950a320c0342802d5e7615f52","original_commit_id":"e3a86290b18b7a7950a320c0342802d5e7615f52","user":{"login":"baholladay","id":345790,"avatar_url":"https://avatars.githubusercontent.com/u/345790?v=3","gravatar_id":"","url":"https://api.github.com/users/baholladay","html_url":"https://github.com/baholladay","followers_url":"https://api.github.com/users/baholladay/followers","following_url":"https://api.github.com/users/baholladay/following{/other_user}","gists_url":"https://api.github.com/users/baholladay/gists{/gist_id}","starred_url":"https://api.github.com/users/baholladay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baholladay/subscriptions","organizations_url":"https://api.github.com/users/baholladay/orgs","repos_url":"https://api.github.com/users/baholladay/repos","events_url":"https://api.github.com/users/baholladay/events{/privacy}","received_events_url":"https://api.github.com/users/baholladay/received_events","type":"User","site_admin":false},"body":"Same as above:\r\nThis call requests every single score for the entire assignment in one call and then cache's the results for the subsequent requests. This can only result in one network call for a page load. There is an additional safety measure that makes sure the score's cache is only called once every 5 minutes at a maximum for any assignment no matter which user requests it.","created_at":"2016-07-11T14:00:08Z","updated_at":"2016-07-11T14:00:08Z","html_url":"https://github.com/instructure/canvas-lms/pull/815#discussion_r70262317","pull_request_url":"https://api.github.com/repos/instructure/canvas-lms/pulls/815","_links":{"self":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/comments/70262317"},"html":{"href":"https://github.com/instructure/canvas-lms/pull/815#discussion_r70262317"},"pull_request":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/815"}}},"pull_request":{"url":"https://api.github.com/repos/instructure/canvas-lms/pulls/815","id":67983305,"html_url":"https://github.com/instructure/canvas-lms/pull/815","diff_url":"https://github.com/instructure/canvas-lms/pull/815.diff","patch_url":"https://github.com/instructure/canvas-lms/pull/815.patch","issue_url":"https://api.github.com/repos/instructure/canvas-lms/issues/815","number":815,"state":"open","locked":false,"title":"VeriCite plugin integration into Assignments, Gradebook, and Speedgrader","user":{"login":"baholladay","id":345790,"avatar_url":"https://avatars.githubusercontent.com/u/345790?v=3","gravatar_id":"","url":"https://api.github.com/users/baholladay","html_url":"https://github.com/baholladay","followers_url":"https://api.github.com/users/baholladay/followers","following_url":"https://api.github.com/users/baholladay/following{/other_user}","gists_url":"https://api.github.com/users/baholladay/gists{/gist_id}","starred_url":"https://api.github.com/users/baholladay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baholladay/subscriptions","organizations_url":"https://api.github.com/users/baholladay/orgs","repos_url":"https://api.github.com/users/baholladay/repos","events_url":"https://api.github.com/users/baholladay/events{/privacy}","received_events_url":"https://api.github.com/users/baholladay/received_events","type":"User","site_admin":false},"body":"I have added VeriCite to the list of \"/plugins\". This is how you enable VeriCite for your account. Once enabled, an option will show up in the assignment settings for \"inline\" or \"upload\" assignment types. This plugin uses all of the existing turnitin data structures in the tables as requested. The only additional DDL required is a flag on the assignments table in order to differentiate which service is enabled:\r\n\r\nalter table assignments ADD vericite_enabled boolean;\r\n\r\nHere is a video of the plugin in action:\r\n\r\nhttps://youtu.be/ttdFkyR1VTM?t=36s (note that it now uses the plugin configuration instead of the account settings shown in the video)","created_at":"2016-04-27T01:23:26Z","updated_at":"2016-07-11T14:00:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76efaba1caed7ab29c57485d2dda3faf1da7d03e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/instructure/canvas-lms/pulls/815/commits","review_comments_url":"https://api.github.com/repos/instructure/canvas-lms/pulls/815/comments","review_comment_url":"https://api.github.com/repos/instructure/canvas-lms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/instructure/canvas-lms/issues/815/comments","statuses_url":"https://api.github.com/repos/instructure/canvas-lms/statuses/e3a86290b18b7a7950a320c0342802d5e7615f52","head":{"label":"baholladay:vericite-master","ref":"vericite-master","sha":"e3a86290b18b7a7950a320c0342802d5e7615f52","user":{"login":"baholladay","id":345790,"avatar_url":"https://avatars.githubusercontent.com/u/345790?v=3","gravatar_id":"","url":"https://api.github.com/users/baholladay","html_url":"https://github.com/baholladay","followers_url":"https://api.github.com/users/baholladay/followers","following_url":"https://api.github.com/users/baholladay/following{/other_user}","gists_url":"https://api.github.com/users/baholladay/gists{/gist_id}","starred_url":"https://api.github.com/users/baholladay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baholladay/subscriptions","organizations_url":"https://api.github.com/users/baholladay/orgs","repos_url":"https://api.github.com/users/baholladay/repos","events_url":"https://api.github.com/users/baholladay/events{/privacy}","received_events_url":"https://api.github.com/users/baholladay/received_events","type":"User","site_admin":false},"repo":{"id":53358367,"name":"canvas-lms","full_name":"baholladay/canvas-lms","owner":{"login":"baholladay","id":345790,"avatar_url":"https://avatars.githubusercontent.com/u/345790?v=3","gravatar_id":"","url":"https://api.github.com/users/baholladay","html_url":"https://github.com/baholladay","followers_url":"https://api.github.com/users/baholladay/followers","following_url":"https://api.github.com/users/baholladay/following{/other_user}","gists_url":"https://api.github.com/users/baholladay/gists{/gist_id}","starred_url":"https://api.github.com/users/baholladay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baholladay/subscriptions","organizations_url":"https://api.github.com/users/baholladay/orgs","repos_url":"https://api.github.com/users/baholladay/repos","events_url":"https://api.github.com/users/baholladay/events{/privacy}","received_events_url":"https://api.github.com/users/baholladay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baholladay/canvas-lms","description":"The open LMS by Instructure, Inc.","fork":true,"url":"https://api.github.com/repos/baholladay/canvas-lms","forks_url":"https://api.github.com/repos/baholladay/canvas-lms/forks","keys_url":"https://api.github.com/repos/baholladay/canvas-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baholladay/canvas-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baholladay/canvas-lms/teams","hooks_url":"https://api.github.com/repos/baholladay/canvas-lms/hooks","issue_events_url":"https://api.github.com/repos/baholladay/canvas-lms/issues/events{/number}","events_url":"https://api.github.com/repos/baholladay/canvas-lms/events","assignees_url":"https://api.github.com/repos/baholladay/canvas-lms/assignees{/user}","branches_url":"https://api.github.com/repos/baholladay/canvas-lms/branches{/branch}","tags_url":"https://api.github.com/repos/baholladay/canvas-lms/tags","blobs_url":"https://api.github.com/repos/baholladay/canvas-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baholladay/canvas-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baholladay/canvas-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/baholladay/canvas-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baholladay/canvas-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/baholladay/canvas-lms/languages","stargazers_url":"https://api.github.com/repos/baholladay/canvas-lms/stargazers","contributors_url":"https://api.github.com/repos/baholladay/canvas-lms/contributors","subscribers_url":"https://api.github.com/repos/baholladay/canvas-lms/subscribers","subscription_url":"https://api.github.com/repos/baholladay/canvas-lms/subscription","commits_url":"https://api.github.com/repos/baholladay/canvas-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/baholladay/canvas-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/baholladay/canvas-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/baholladay/canvas-lms/issues/comments{/number}","contents_url":"https://api.github.com/repos/baholladay/canvas-lms/contents/{+path}","compare_url":"https://api.github.com/repos/baholladay/canvas-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baholladay/canvas-lms/merges","archive_url":"https://api.github.com/repos/baholladay/canvas-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baholladay/canvas-lms/downloads","issues_url":"https://api.github.com/repos/baholladay/canvas-lms/issues{/number}","pulls_url":"https://api.github.com/repos/baholladay/canvas-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/baholladay/canvas-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/baholladay/canvas-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baholladay/canvas-lms/labels{/name}","releases_url":"https://api.github.com/repos/baholladay/canvas-lms/releases{/id}","deployments_url":"https://api.github.com/repos/baholladay/canvas-lms/deployments","created_at":"2016-03-07T20:54:53Z","updated_at":"2016-03-07T20:55:18Z","pushed_at":"2016-07-02T23:25:16Z","git_url":"git://github.com/baholladay/canvas-lms.git","ssh_url":"git@github.com:baholladay/canvas-lms.git","clone_url":"https://github.com/baholladay/canvas-lms.git","svn_url":"https://github.com/baholladay/canvas-lms","homepage":"https://github.com/instructure/canvas-lms/wiki","size":240003,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"stable"}},"base":{"label":"instructure:master","ref":"master","sha":"3b62ee4006b5fe312be61566548ba365baf1bb38","user":{"login":"instructure","id":515326,"avatar_url":"https://avatars.githubusercontent.com/u/515326?v=3","gravatar_id":"","url":"https://api.github.com/users/instructure","html_url":"https://github.com/instructure","followers_url":"https://api.github.com/users/instructure/followers","following_url":"https://api.github.com/users/instructure/following{/other_user}","gists_url":"https://api.github.com/users/instructure/gists{/gist_id}","starred_url":"https://api.github.com/users/instructure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instructure/subscriptions","organizations_url":"https://api.github.com/users/instructure/orgs","repos_url":"https://api.github.com/users/instructure/repos","events_url":"https://api.github.com/users/instructure/events{/privacy}","received_events_url":"https://api.github.com/users/instructure/received_events","type":"Organization","site_admin":false},"repo":{"id":1314319,"name":"canvas-lms","full_name":"instructure/canvas-lms","owner":{"login":"instructure","id":515326,"avatar_url":"https://avatars.githubusercontent.com/u/515326?v=3","gravatar_id":"","url":"https://api.github.com/users/instructure","html_url":"https://github.com/instructure","followers_url":"https://api.github.com/users/instructure/followers","following_url":"https://api.github.com/users/instructure/following{/other_user}","gists_url":"https://api.github.com/users/instructure/gists{/gist_id}","starred_url":"https://api.github.com/users/instructure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/instructure/subscriptions","organizations_url":"https://api.github.com/users/instructure/orgs","repos_url":"https://api.github.com/users/instructure/repos","events_url":"https://api.github.com/users/instructure/events{/privacy}","received_events_url":"https://api.github.com/users/instructure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/instructure/canvas-lms","description":"The open LMS by Instructure, Inc.","fork":false,"url":"https://api.github.com/repos/instructure/canvas-lms","forks_url":"https://api.github.com/repos/instructure/canvas-lms/forks","keys_url":"https://api.github.com/repos/instructure/canvas-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/instructure/canvas-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/instructure/canvas-lms/teams","hooks_url":"https://api.github.com/repos/instructure/canvas-lms/hooks","issue_events_url":"https://api.github.com/repos/instructure/canvas-lms/issues/events{/number}","events_url":"https://api.github.com/repos/instructure/canvas-lms/events","assignees_url":"https://api.github.com/repos/instructure/canvas-lms/assignees{/user}","branches_url":"https://api.github.com/repos/instructure/canvas-lms/branches{/branch}","tags_url":"https://api.github.com/repos/instructure/canvas-lms/tags","blobs_url":"https://api.github.com/repos/instructure/canvas-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/instructure/canvas-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/instructure/canvas-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/instructure/canvas-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/instructure/canvas-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/instructure/canvas-lms/languages","stargazers_url":"https://api.github.com/repos/instructure/canvas-lms/stargazers","contributors_url":"https://api.github.com/repos/instructure/canvas-lms/contributors","subscribers_url":"https://api.github.com/repos/instructure/canvas-lms/subscribers","subscription_url":"https://api.github.com/repos/instructure/canvas-lms/subscription","commits_url":"https://api.github.com/repos/instructure/canvas-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/instructure/canvas-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/instructure/canvas-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/instructure/canvas-lms/issues/comments{/number}","contents_url":"https://api.github.com/repos/instructure/canvas-lms/contents/{+path}","compare_url":"https://api.github.com/repos/instructure/canvas-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/instructure/canvas-lms/merges","archive_url":"https://api.github.com/repos/instructure/canvas-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/instructure/canvas-lms/downloads","issues_url":"https://api.github.com/repos/instructure/canvas-lms/issues{/number}","pulls_url":"https://api.github.com/repos/instructure/canvas-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/instructure/canvas-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/instructure/canvas-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/instructure/canvas-lms/labels{/name}","releases_url":"https://api.github.com/repos/instructure/canvas-lms/releases{/id}","deployments_url":"https://api.github.com/repos/instructure/canvas-lms/deployments","created_at":"2011-02-01T00:08:40Z","updated_at":"2016-07-11T01:41:16Z","pushed_at":"2016-07-11T11:20:10Z","git_url":"git://github.com/instructure/canvas-lms.git","ssh_url":"git@github.com:instructure/canvas-lms.git","clone_url":"https://github.com/instructure/canvas-lms.git","svn_url":"https://github.com/instructure/canvas-lms","homepage":"https://github.com/instructure/canvas-lms/wiki","size":272610,"stargazers_count":1764,"watchers_count":1764,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":764,"mirror_url":null,"open_issues_count":79,"forks":764,"open_issues":79,"watchers":1764,"default_branch":"stable"}},"_links":{"self":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/815"},"html":{"href":"https://github.com/instructure/canvas-lms/pull/815"},"issue":{"href":"https://api.github.com/repos/instructure/canvas-lms/issues/815"},"comments":{"href":"https://api.github.com/repos/instructure/canvas-lms/issues/815/comments"},"review_comments":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/815/comments"},"review_comment":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/instructure/canvas-lms/pulls/815/commits"},"statuses":{"href":"https://api.github.com/repos/instructure/canvas-lms/statuses/e3a86290b18b7a7950a320c0342802d5e7615f52"}}}}
{"actor":{"display_login":"baholladay"}}