- renderer = g.renderer - unless g.display_type == "hidden" = f.inputs "#{next_question_number(g)}#{g.text_for(@render_context, I18n.locale)}", :id => "g_#{g.id}", :class => "g_#{renderer} #{g.css_class(@response_set)}" do %li.help= g.help_text_for(@render_context, I18n.locale) - case renderer - when :grid - if qs.first.question_type_id == :grid_dropdown %li %table %col.pre - g.columns.each do |column| %col{:class => cycle("odd", "even")} %col.pre %col.post %tbody - g.columns.each_slice(10) do |ten_columns| %tr %th   - ten_columns.each do |column| %th = column.text_for(nil, @render_context, I18n.locale) - qs.each_with_index do |q, i| %tr{:id => "q_#{q.id}", :class => "q_#{renderer} #{q.css_class(@response_set)}"} %td = q.text_for(:pre, @render_context, I18n.locale) - ten_columns.each_with_index do |column, i| %td - r = response_for(@response_set, q, nil, nil, column.id) - i = response_idx # increment the response index since the answer partial skips for q.pick == one = f.semantic_fields_for i, r do |ff| = ff.input :question_id, :as => :quiet = ff.input :api_id, :as => :quiet = ff.input :column_id, :value => column.id, :as => :quiet = ff.input :answer_id, :as => :select, :collection => q.answers.where('column_id=?',column.id).map{|a| [a.text, a.id]}, :label => false, :response_class => "answer" - else %li %table %col.pre - qs.first.answers.each do |a| %col{:class => cycle("odd", "even")} %col.post %tbody - qs.each_slice(10) do |ten_questions| # header row every 10 %tr %th   - ten_questions.first.answers.each do |a| %th = a.text_for(nil, @render_context, I18n.locale) %span.help= a.help_text_for(@render_context, I18n.locale) %th   - ten_questions.each_with_index do |q, i| %tr{:id => "q_#{q.id}", :class => "q_#{renderer} #{q.css_class(@response_set)}"} %th = q.text_for(:pre, @render_context, I18n.locale) = q.help_text_for(@render_context, I18n.locale) - if q.pick == "one" - r = response_for(@response_set, q, nil, g) - i = response_idx # increment the response index since the answer partial skips for q.pick == one = f.semantic_fields_for i, r do |ff| = ff.input :question_id, :as => :quiet = ff.input :api_id, :as => :quiet - q.answers.each do |a| %td= render(a.custom_renderer || '/partials/answer', :g => g, :q => q, :a => a, :f => f) unless q.display_type == "label" %th= q.text_for(:post, @render_context, I18n.locale) - when :repeater - (@response_set.count_group_responses(qs) + 1).times do |rg| %li - qs.each do |q| = render q.custom_renderer || "/partials/question", :g => g, :rg => rg, :q => q, :f => f = submit_tag("+ add row", :name => "section[#{@section.id}][g_#{g.id}]", :class => "add_row") - else # :inline - qs.each do |q| = render q.custom_renderer || "/partials/question", :g => g, :q => q, :f => f