lib/domoscio_rails.rb in domoscio_rails-0.4.4 vs lib/domoscio_rails.rb in domoscio_rails-0.4.5

- old
+ new

@@ -19,10 +19,11 @@ require 'domoscio_rails/knowledge/knowledge_edge' require 'domoscio_rails/knowledge/knowledge_graph' require 'domoscio_rails/knowledge/knowledge_node_content' require 'domoscio_rails/knowledge/knowledge_node_student' require 'domoscio_rails/knowledge/knowledge_node' +require 'domoscio_rails/objective/learning_program_student' require 'domoscio_rails/objective/learning_program' require 'domoscio_rails/objective/objective_knowledge_node_student' require 'domoscio_rails/objective/objective_knowledge_node' require 'domoscio_rails/objective/objective_student' require 'domoscio_rails/objective/objective' @@ -33,10 +34,11 @@ require 'domoscio_rails/tag/tagging' require 'domoscio_rails/utils/gameplay_util' require 'domoscio_rails/utils/recommendation_util' require 'domoscio_rails/utils/review_util' require 'domoscio_rails/utils/stats_util' +require 'domoscio_rails/scorm/scorm' module DomoscioRails # Configurable attributes and default values class Configuration attr_accessor :client_id, :client_passphrase, :temp_dir, :version, @@ -80,10 +82,16 @@ response = DomoscioRails.send_request(uri, method, params, headers) return response if response.is_a? DomoscioRails::ProcessingError begin raise_http_failure(uri, response, params) - data = DomoscioRails::JSON.load(response.body.nil? ? '' : response.body) + + if response['Content-Type'] == 'application/zip' + data = response + else + data = DomoscioRails::JSON.load(response.body.nil? ? '' : response.body) + end + if store_tokens DomoscioRails::AuthorizationToken::Manager.storage.store({ access_token: response['Accesstoken'], refresh_token: response['Refreshtoken'] })