Sha256: 02b8eac7e3ac9d5b43167d0ceb3d6d1d5702082ac34bff4c1d44b52729a29c80

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

%table
  %tr.question_group
    %td
    %td
    %td
      %table
        %tr.question_group_header
          %td User Id
          - question_group.questions.each do |group_question|
            %td
              = group_question.text
       
        - questions    = question_group.questions
        - question_ids = questions.collect(&:id)
        - responses = @responses.where('responses.question_id in (?)', question_ids).map{|r| {response_set_id: r.response_set_id, question_id: r.question_id, response: r.response_value}}
        - @response_sets.each do |response_set| 
          - (responses.select{|response| response[:response_set_id]==response_set.id}.count/question_ids.count).times do |index|
            %tr{class: index==0 ? "first_row" : nil}
              %td
                %span.user_id
                  = response_set.report_user_name
              - questions.each do |question|
                %td
                  - if response = responses.select{|response| response[:response_set_id] == response_set.id && response[:question_id] == question.id}[index]
                    - response_formatter = ReportFormatter.new(question, @responses)
                    = response_formatter.format_stats(response[:response])
          = render "surveyor_gui/shared/new_line"

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
upgrade_surveyor_gui-0.1.3 app/views/surveyor_gui/reports/_repeater.html.haml
upgrade_surveyor_gui-0.1.2 app/views/surveyor_gui/reports/_repeater.html.haml
surveyor_gui-0.1.2 app/views/surveyor_gui/reports/_repeater.html.haml