{"action":"created","comment":{"url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/comments/92757276","pull_request_review_id":13277764,"id":92757276,"diff_hunk":"@@ -54,7 +65,71 @@ def self.from_metadata(metadata)\n             name: course_name,\n           },\n         )\n-      CanvasCourse.new(metadata, canvas_course)\n+      CanvasCourse.new(metadata, canvas_course, blackboard_export)\n+    end\n+\n+    ##\n+    # Creates a canvas assignment from a scorm package that has already been\n+    # uploaded to a scorm manager\n+    ##\n+    def create_scorm_assignment(scorm_package, course_id)\n+      url = \"#{Blacklight.scorm_launch_url}?\" +\n+        \"course_id=#{scorm_package['package_id']}\"\n+\n+      payload = {\n+        assignment__name__: scorm_package[\"title\"],\n+        assignment__submission_types__: [\"external_tool\"],\n+        assignment__integration_id__: scorm_package[\"package_id\"],\n+        assignment__integration_data__: { provider: \"atomic-scorm\" },\n+        assignment__external_tool_tag_attributes__: {\n+          url: url,\n+        },\n+      }\n+\n+      CanvasCourse.client.create_assignment(\n+        course_id,\n+        scorm_package[\"title\"],\n+        payload,\n+      )\n+    end\n+\n+    ##\n+    # Uploads a scorm package to scorm manager specified in blacklight.yml\n+    # config file\n+    ##\n+    def upload_scorm_package(scorm_package, course_id, tmp_name)\n+      zip = scorm_package.write_zip tmp_name\n+      RestClient.post(\n+        \"#{Blacklight.scorm_url}/api/scorm_courses\",\n+        {\n+          oauth_consumer_key: \"scorm-player\",\n+          lms_course_id: course_id,\n+          file: File.new(zip, \"rb\"),\n+        },\n+        SharedAuthorization: Blacklight.scorm_shared_auth,\n+      ) do |resp|\n+        return JSON.parse(resp.body)[\"response\"]","path":"lib/blacklight/canvas_course.rb","position":85,"original_position":85,"commit_id":"7ae5656e7ebe87ef366f3c8410749246bc4fb713","original_commit_id":"7ae5656e7ebe87ef366f3c8410749246bc4fb713","user":{"login":"bfcoder","id":1216167,"avatar_url":"https://avatars.githubusercontent.com/u/1216167?v=3","gravatar_id":"","url":"https://api.github.com/users/bfcoder","html_url":"https://github.com/bfcoder","followers_url":"https://api.github.com/users/bfcoder/followers","following_url":"https://api.github.com/users/bfcoder/following{/other_user}","gists_url":"https://api.github.com/users/bfcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/bfcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfcoder/subscriptions","organizations_url":"https://api.github.com/users/bfcoder/orgs","repos_url":"https://api.github.com/users/bfcoder/repos","events_url":"https://api.github.com/users/bfcoder/events{/privacy}","received_events_url":"https://api.github.com/users/bfcoder/received_events","type":"User","site_admin":false},"body":"Remove the return here, it is unnecessary in ruby.","created_at":"2016-12-16T06:11:33Z","updated_at":"2016-12-16T06:11:33Z","html_url":"https://github.com/atomicjolt/blacklight/pull/13#discussion_r92757276","pull_request_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/comments/92757276"},"html":{"href":"https://github.com/atomicjolt/blacklight/pull/13#discussion_r92757276"},"pull_request":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13","id":98040548,"html_url":"https://github.com/atomicjolt/blacklight/pull/13","diff_url":"https://github.com/atomicjolt/blacklight/pull/13.diff","patch_url":"https://github.com/atomicjolt/blacklight/pull/13.patch","issue_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/13","number":13,"state":"open","locked":false,"title":"Add scorm support","user":{"login":"nick-benoit14","id":9383215,"avatar_url":"https://avatars.githubusercontent.com/u/9383215?v=3","gravatar_id":"","url":"https://api.github.com/users/nick-benoit14","html_url":"https://github.com/nick-benoit14","followers_url":"https://api.github.com/users/nick-benoit14/followers","following_url":"https://api.github.com/users/nick-benoit14/following{/other_user}","gists_url":"https://api.github.com/users/nick-benoit14/gists{/gist_id}","starred_url":"https://api.github.com/users/nick-benoit14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nick-benoit14/subscriptions","organizations_url":"https://api.github.com/users/nick-benoit14/orgs","repos_url":"https://api.github.com/users/nick-benoit14/repos","events_url":"https://api.github.com/users/nick-benoit14/events{/privacy}","received_events_url":"https://api.github.com/users/nick-benoit14/received_events","type":"User","site_admin":false},"body":"* Adds ability to extract scorm packages from blackboard export \r\n* Adds ability to upload scorm packages to scorm manager 'adhesion' \r\n* Adds ability to create assignments from uploaded scorm packages\r\n* Authenticates scorm manager requests ","created_at":"2016-12-14T21:36:19Z","updated_at":"2016-12-16T06:11:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da0e12152e1e027cf58adeeb33fdb076a5bbdb67","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13/commits","review_comments_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13/comments","review_comment_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/13/comments","statuses_url":"https://api.github.com/repos/atomicjolt/blacklight/statuses/7ae5656e7ebe87ef366f3c8410749246bc4fb713","head":{"label":"atomicjolt:add_scorm_support","ref":"add_scorm_support","sha":"7ae5656e7ebe87ef366f3c8410749246bc4fb713","user":{"login":"atomicjolt","id":7516397,"avatar_url":"https://avatars.githubusercontent.com/u/7516397?v=3","gravatar_id":"","url":"https://api.github.com/users/atomicjolt","html_url":"https://github.com/atomicjolt","followers_url":"https://api.github.com/users/atomicjolt/followers","following_url":"https://api.github.com/users/atomicjolt/following{/other_user}","gists_url":"https://api.github.com/users/atomicjolt/gists{/gist_id}","starred_url":"https://api.github.com/users/atomicjolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomicjolt/subscriptions","organizations_url":"https://api.github.com/users/atomicjolt/orgs","repos_url":"https://api.github.com/users/atomicjolt/repos","events_url":"https://api.github.com/users/atomicjolt/events{/privacy}","received_events_url":"https://api.github.com/users/atomicjolt/received_events","type":"Organization","site_admin":false},"repo":{"id":73236360,"name":"blacklight","full_name":"atomicjolt/blacklight","owner":{"login":"atomicjolt","id":7516397,"avatar_url":"https://avatars.githubusercontent.com/u/7516397?v=3","gravatar_id":"","url":"https://api.github.com/users/atomicjolt","html_url":"https://github.com/atomicjolt","followers_url":"https://api.github.com/users/atomicjolt/followers","following_url":"https://api.github.com/users/atomicjolt/following{/other_user}","gists_url":"https://api.github.com/users/atomicjolt/gists{/gist_id}","starred_url":"https://api.github.com/users/atomicjolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomicjolt/subscriptions","organizations_url":"https://api.github.com/users/atomicjolt/orgs","repos_url":"https://api.github.com/users/atomicjolt/repos","events_url":"https://api.github.com/users/atomicjolt/events{/privacy}","received_events_url":"https://api.github.com/users/atomicjolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atomicjolt/blacklight","description":null,"fork":false,"url":"https://api.github.com/repos/atomicjolt/blacklight","forks_url":"https://api.github.com/repos/atomicjolt/blacklight/forks","keys_url":"https://api.github.com/repos/atomicjolt/blacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atomicjolt/blacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atomicjolt/blacklight/teams","hooks_url":"https://api.github.com/repos/atomicjolt/blacklight/hooks","issue_events_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/events{/number}","events_url":"https://api.github.com/repos/atomicjolt/blacklight/events","assignees_url":"https://api.github.com/repos/atomicjolt/blacklight/assignees{/user}","branches_url":"https://api.github.com/repos/atomicjolt/blacklight/branches{/branch}","tags_url":"https://api.github.com/repos/atomicjolt/blacklight/tags","blobs_url":"https://api.github.com/repos/atomicjolt/blacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atomicjolt/blacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atomicjolt/blacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/atomicjolt/blacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atomicjolt/blacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/atomicjolt/blacklight/languages","stargazers_url":"https://api.github.com/repos/atomicjolt/blacklight/stargazers","contributors_url":"https://api.github.com/repos/atomicjolt/blacklight/contributors","subscribers_url":"https://api.github.com/repos/atomicjolt/blacklight/subscribers","subscription_url":"https://api.github.com/repos/atomicjolt/blacklight/subscription","commits_url":"https://api.github.com/repos/atomicjolt/blacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/atomicjolt/blacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/atomicjolt/blacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/atomicjolt/blacklight/contents/{+path}","compare_url":"https://api.github.com/repos/atomicjolt/blacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atomicjolt/blacklight/merges","archive_url":"https://api.github.com/repos/atomicjolt/blacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atomicjolt/blacklight/downloads","issues_url":"https://api.github.com/repos/atomicjolt/blacklight/issues{/number}","pulls_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/atomicjolt/blacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/atomicjolt/blacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atomicjolt/blacklight/labels{/name}","releases_url":"https://api.github.com/repos/atomicjolt/blacklight/releases{/id}","deployments_url":"https://api.github.com/repos/atomicjolt/blacklight/deployments","created_at":"2016-11-08T23:31:48Z","updated_at":"2016-11-09T15:49:18Z","pushed_at":"2016-12-16T05:59:15Z","git_url":"git://github.com/atomicjolt/blacklight.git","ssh_url":"git@github.com:atomicjolt/blacklight.git","clone_url":"https://github.com/atomicjolt/blacklight.git","svn_url":"https://github.com/atomicjolt/blacklight","homepage":null,"size":40150,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"master"}},"base":{"label":"atomicjolt:master","ref":"master","sha":"2282e30acef874456acf345d94b985332784abe1","user":{"login":"atomicjolt","id":7516397,"avatar_url":"https://avatars.githubusercontent.com/u/7516397?v=3","gravatar_id":"","url":"https://api.github.com/users/atomicjolt","html_url":"https://github.com/atomicjolt","followers_url":"https://api.github.com/users/atomicjolt/followers","following_url":"https://api.github.com/users/atomicjolt/following{/other_user}","gists_url":"https://api.github.com/users/atomicjolt/gists{/gist_id}","starred_url":"https://api.github.com/users/atomicjolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomicjolt/subscriptions","organizations_url":"https://api.github.com/users/atomicjolt/orgs","repos_url":"https://api.github.com/users/atomicjolt/repos","events_url":"https://api.github.com/users/atomicjolt/events{/privacy}","received_events_url":"https://api.github.com/users/atomicjolt/received_events","type":"Organization","site_admin":false},"repo":{"id":73236360,"name":"blacklight","full_name":"atomicjolt/blacklight","owner":{"login":"atomicjolt","id":7516397,"avatar_url":"https://avatars.githubusercontent.com/u/7516397?v=3","gravatar_id":"","url":"https://api.github.com/users/atomicjolt","html_url":"https://github.com/atomicjolt","followers_url":"https://api.github.com/users/atomicjolt/followers","following_url":"https://api.github.com/users/atomicjolt/following{/other_user}","gists_url":"https://api.github.com/users/atomicjolt/gists{/gist_id}","starred_url":"https://api.github.com/users/atomicjolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atomicjolt/subscriptions","organizations_url":"https://api.github.com/users/atomicjolt/orgs","repos_url":"https://api.github.com/users/atomicjolt/repos","events_url":"https://api.github.com/users/atomicjolt/events{/privacy}","received_events_url":"https://api.github.com/users/atomicjolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atomicjolt/blacklight","description":null,"fork":false,"url":"https://api.github.com/repos/atomicjolt/blacklight","forks_url":"https://api.github.com/repos/atomicjolt/blacklight/forks","keys_url":"https://api.github.com/repos/atomicjolt/blacklight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atomicjolt/blacklight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atomicjolt/blacklight/teams","hooks_url":"https://api.github.com/repos/atomicjolt/blacklight/hooks","issue_events_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/events{/number}","events_url":"https://api.github.com/repos/atomicjolt/blacklight/events","assignees_url":"https://api.github.com/repos/atomicjolt/blacklight/assignees{/user}","branches_url":"https://api.github.com/repos/atomicjolt/blacklight/branches{/branch}","tags_url":"https://api.github.com/repos/atomicjolt/blacklight/tags","blobs_url":"https://api.github.com/repos/atomicjolt/blacklight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atomicjolt/blacklight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atomicjolt/blacklight/git/refs{/sha}","trees_url":"https://api.github.com/repos/atomicjolt/blacklight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atomicjolt/blacklight/statuses/{sha}","languages_url":"https://api.github.com/repos/atomicjolt/blacklight/languages","stargazers_url":"https://api.github.com/repos/atomicjolt/blacklight/stargazers","contributors_url":"https://api.github.com/repos/atomicjolt/blacklight/contributors","subscribers_url":"https://api.github.com/repos/atomicjolt/blacklight/subscribers","subscription_url":"https://api.github.com/repos/atomicjolt/blacklight/subscription","commits_url":"https://api.github.com/repos/atomicjolt/blacklight/commits{/sha}","git_commits_url":"https://api.github.com/repos/atomicjolt/blacklight/git/commits{/sha}","comments_url":"https://api.github.com/repos/atomicjolt/blacklight/comments{/number}","issue_comment_url":"https://api.github.com/repos/atomicjolt/blacklight/issues/comments{/number}","contents_url":"https://api.github.com/repos/atomicjolt/blacklight/contents/{+path}","compare_url":"https://api.github.com/repos/atomicjolt/blacklight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atomicjolt/blacklight/merges","archive_url":"https://api.github.com/repos/atomicjolt/blacklight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atomicjolt/blacklight/downloads","issues_url":"https://api.github.com/repos/atomicjolt/blacklight/issues{/number}","pulls_url":"https://api.github.com/repos/atomicjolt/blacklight/pulls{/number}","milestones_url":"https://api.github.com/repos/atomicjolt/blacklight/milestones{/number}","notifications_url":"https://api.github.com/repos/atomicjolt/blacklight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atomicjolt/blacklight/labels{/name}","releases_url":"https://api.github.com/repos/atomicjolt/blacklight/releases{/id}","deployments_url":"https://api.github.com/repos/atomicjolt/blacklight/deployments","created_at":"2016-11-08T23:31:48Z","updated_at":"2016-11-09T15:49:18Z","pushed_at":"2016-12-16T05:59:15Z","git_url":"git://github.com/atomicjolt/blacklight.git","ssh_url":"git@github.com:atomicjolt/blacklight.git","clone_url":"https://github.com/atomicjolt/blacklight.git","svn_url":"https://github.com/atomicjolt/blacklight","homepage":null,"size":40150,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13"},"html":{"href":"https://github.com/atomicjolt/blacklight/pull/13"},"issue":{"href":"https://api.github.com/repos/atomicjolt/blacklight/issues/13"},"comments":{"href":"https://api.github.com/repos/atomicjolt/blacklight/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atomicjolt/blacklight/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/atomicjolt/blacklight/statuses/7ae5656e7ebe87ef366f3c8410749246bc4fb713"}}}}
{"actor":{"display_login":"bfcoder"}}