Sha256: c8f91e4c0042caee98dc048fcfb7806a3f3f024a538c814c3c37e3d017690c7e

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

module ThinkFeelDoEngine
  module Reports
    # Scenario: Participants complete a Wai Assessment by email.
    class WaiAssessment
      def self.columns
        %w( participant_id date_transmitted date_completed wai1 wai2 wai3 wai4
            wai5 wai6 wai7 wai8 wai9 wai10 wai11 wai12 )
      end

      def self.all
        Participant.not_moderator.select(:id, :study_id).map do |participant|
          participant.wai_assessments.map do |assessment|
            {
              participant_id: participant.study_id,
              date_transmitted: assessment.release_date.iso8601,
              date_completed: assessment.updated_at.to_date.iso8601,
              wai1: assessment.q1,
              wai2: assessment.q2,
              wai3: assessment.q3,
              wai4: assessment.q4,
              wai5: assessment.q5,
              wai6: assessment.q6,
              wai7: assessment.q7,
              wai8: assessment.q8,
              wai9: assessment.q9,
              wai10: assessment.q10,
              wai11: assessment.q11,
              wai12: assessment.q12
            }
          end
        end.flatten
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.8 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.7 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.6 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.5 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.4 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.3 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.2 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.1 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.19.0 app/models/think_feel_do_engine/reports/wai_assessment.rb
think_feel_do_engine-3.18.0 app/models/think_feel_do_engine/reports/wai_assessment.rb