Sha256: 17356c3986833a8491e5d68f5c01f7f0f6235a578949db269980d8aa9b4c25b5

Contents?: true

Size: 916 Bytes

Versions: 4

Compression:

Stored size: 916 Bytes

Contents

module Qualtrics
  class Submission < Entity

    attr_accessor :id, :survey_id, :distribution_id, :finished_survey, :time_stamp

    def initialize(options={})
      @id = options[:id]
      @survey_id = options[:survey_id]
      @distribution_id = options[:distribution_id]
      @finished_survey = options[:finished_survey]
      @time_stamp = options[:time_stamp]
    end

    def csv_result
      response = get('getLegacyResponseData', {
        'SurveyID' => survey_id,
        'ResponseID' => id,
        'Format' => 'CSV',
        'ExportTags' => 1
      })

      if response.status == 200
        response
      else
        false
      end
    end

    def self.attribute_map
      {
        'ResponseID' => :id,
        'SurveyID' => :survey_id,
        'TimeStamp' => :time_stamp,
        'EmailDistributionID' => :distribution_id,
        'FinishedSurvey' => :finished_survey
      }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qualtrics-0.5.9 lib/qualtrics/submission.rb
qualtrics-0.5.8 lib/qualtrics/submission.rb
qualtrics-0.5.7 lib/qualtrics/submission.rb
qualtrics-0.5.6 lib/qualtrics/submission.rb