Took JP's migration scorm script to test.
This commit is contained in:
43
Scripts/Migration_tool/create_scorm_activities.py
Normal file
43
Scripts/Migration_tool/create_scorm_activities.py
Normal file
@ -0,0 +1,43 @@
|
||||
from utils import apikeys
|
||||
import requests
|
||||
|
||||
# JSON Payload for SCORM file
|
||||
baseurl = "https://api.northpass.com"
|
||||
endpoint = f"{baseUrl}/v2/migration/projects/{projectid}/items/{activityitemid}/activity_resources"
|
||||
|
||||
# Migration Sandbox Items
|
||||
# projectid = "f33ce6c1-65cf-48a2-96c8-825beee2ff88"
|
||||
# activityId = "49ebb402-39ed-4aeb-8ed4-801cd0c09fd1"
|
||||
# course_uuid = "07b97dea-ca66-4a9c-ae32-ebf3aa7205c2"
|
||||
|
||||
# Norm's Sandbox Items:
|
||||
course_uuid = "5bee0361-3161-4d9b-9369-cba4bb4b2d84"
|
||||
|
||||
apikey = apikeys.NORMSANDBOX
|
||||
headers = { "X-Api-Key": apikey, "content-type": "application/json" }
|
||||
payload = {
|
||||
"data": [
|
||||
{
|
||||
"type": "activity_resource",
|
||||
"attributes": {
|
||||
"uuid": "6aeea279-e70e-40b8-98a0-776fa93779d8",
|
||||
"display_name": "SCORM File 38",
|
||||
"data": {
|
||||
"name": "Introduction to Agile - SCORM",
|
||||
"type": "activities/scorm_sco",
|
||||
"course_id": course_uuid,
|
||||
"section_id": "72efe0d0-b8ae-48db-ac71-cd2f450ec2e8",
|
||||
"activity_attributes": {
|
||||
"scorm_sco_id": "a1ee4933-74b9-4d5f-ab88-380db1d04d7a",
|
||||
"description": "Explore Agile as a concept and why it's effective in today's project environments. SCORM file",
|
||||
"position": 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
# post_load = requests.post(endpoint, headers=headers, json=payload)
|
||||
print(post_load.text)
|
||||
print(post_load.status_code)
|
||||
@ -1 +1,3 @@
|
||||
SANDBOX = "SlpQlju219WnWogn94dQUT6Yt"
|
||||
NORMSANDBOX = "SlpQlju219WnWogn94dQUT6Yt"
|
||||
MIGSANDBOX = "UMI9RTQAKeDaFgDsNPw4vds5"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user