Skip to content

Commit 0cac8c4

Browse files
committed
BRD-20938 another scormEngine v2 response update
1 parent 99710c9 commit 0cac8c4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/scorm_engine/models/course_import.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ def self.new_from_api(options = {})
3535
if options.fetch("importResult", {}).key?("course")
3636
this.course = Course.new_from_api(options.fetch("importResult", {})["course"])
3737
end
38+
elsif options.key?("result") && options.size == 1
39+
# Initial import response format: {"result": "job-id"}
40+
this.id = options["result"]
41+
this.status = "RUNNING" # Assume running for initial response
3842
else
39-
# API v1 response structure
43+
# API v1 response structure or full status response
4044
this.id = options["jobId"]
4145
this.status = options["status"]&.upcase
4246
this.course = Course.new_from_api(options["course"]) if options.key?("course") # unavailable in error states

0 commit comments

Comments
 (0)