<% if element.kind == "Fe::QuestionGrid" || element.kind == "Fe::QuestionGridWithTotal"-%>
  • <%- if element.cols -%> <%- element.cols.split(';').each do |header| -%> <%- end -%> <%- end -%> <%- col_count = 0 element.elements.each do |grid_element| -%> <%- col_count += 1 if col_count % element.num_cols == 0 then col_count = 0 -%><%- end -%> <%- end -%> <%- while col_count < element.num_cols do col_count += 1-%> <%- end unless col_count == 0-%>
    <%= raw header || ' ' %>
    <% if %w(Fe::Paragraph).include?(grid_element.kind) -%> <%= simple_format grid_element.content %> <% else -%> <%# el = elements.detect {|el| el.id == grid_element.id } -%> <% if grid_element.question? -%> <%- if @collating -%> <%- for answer_sheet in @collated_answer_sheets[@answer_sheet] -%>
    <%= answer_sheet.collat_title %>: <%= simple_format grid_element.display_response(answer_sheet) %>
    <%- end -%> <%- else -%> <%= simple_format grid_element.display_response(@answer_sheet) %> <%- end -%> <% elsif grid_element.is_a?(Fe::QuestionGrid) || grid_element.is_a?(Fe::QuestionGridWithTotal) %>
      <%= render :partial => 'fe/answer_sheets/element', :object => grid_element %>
    <% else %> <%= render :partial => 'fe/questions/' + element.ptemplate, :object => element %> <% end %> <% end -%>
     
  • <% else %>
  • <% if element.question? -%> <%- if @collating -%> <%- for answer_sheet in @collated_answer_sheets[@answer_sheet] -%>
    <%= answer_sheet.collat_title %>: <%= simple_format element.display_response(answer_sheet) %>
    <%- end -%> <%- else -%> <%= simple_format element.display_response(@answer_sheet) %> <%- end -%> <% else -%> <%= render :partial => 'fe/questions/' + element.ptemplate, :object => element %> <% end -%>
  • <% element.choice_field_children.each do |choice_field_child| %> <%= render 'fe/answer_sheets/element', element: choice_field_child %> <% end %> <% end -%>