Sha256: b09580e9ef6f7c41bfdbf6425c9b3802311a56bc977e2879b1f5660e05f7c4bc

Contents?: true

Size: 663 Bytes

Versions: 12

Compression:

Stored size: 663 Bytes

Contents

module Qualtrics
  class SurveyImport < Entity
    attr_accessor :survey_name, :survey, :survey_data_location

    def initialize(options={})
      @survey_name = options[:survey_name]
      @survey_data_location = options[:survey_data_location]
      @survey = Qualtrics::Survey.new(survey_name: survey_name)
    end

    def save
      payload = {}
      payload['Name'] = survey.survey_name
      payload['Data'] = Faraday::UploadIO.new(survey_data_location, 'text/xml')

      response = post 'importSurvey', payload

      if response.success?
        survey.id = response.result['SurveyID']
        true
      else
        false
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
qualtrics-0.6.1 lib/qualtrics/survey_import.rb
qualtrics-0.6.0 lib/qualtrics/survey_import.rb
qualtrics-0.5.9b lib/qualtrics/survey_import.rb
qualtrics-0.5.9 lib/qualtrics/survey_import.rb
qualtrics-0.5.8 lib/qualtrics/survey_import.rb
qualtrics-0.5.7 lib/qualtrics/survey_import.rb
qualtrics-0.5.6 lib/qualtrics/survey_import.rb
qualtrics-0.5.5 lib/qualtrics/survey_import.rb
qualtrics-0.5.4 lib/qualtrics/survey_import.rb
qualtrics-0.5.3 lib/qualtrics/survey_import.rb
qualtrics-0.5.2 lib/qualtrics/survey_import.rb
qualtrics-0.5.1 lib/qualtrics/survey_import.rb