Sha256: 6053b3926e76a6daeaa90951ecafeb9648b032b5fa86adbe4157730710e820eb

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

<% if element.kind == "Fe::QuestionGrid" -%>
  <li>
  	<label class="desc"><%= raw element.label %></label>
  	<table class="grid">
  	<%- if element.cols -%>
  	<tr>
  	<%- element.cols.split(';').each do |header| -%>
  		<th><%= raw header || '&nbsp;' %></th>
  	<%- end -%>
  	</tr>
  	<%- end -%>
  	<tr>
  		<%- col_count = 0
  			element.elements.each do |grid_element| -%>
  		<td id="element_<%= element.id %>">
  			<% 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? -%>
                          <label class="desc"><%= raw grid_element.label %></label>
                        <% end %>
                        <span class="answer"><%= simple_format grid_element.display_response(@answer_sheet) %></span>
  			<% end -%>
  		</td>
  		<%- 	col_count += 1
  				if col_count % element.num_cols == 0 then col_count = 0 -%></tr><tr><%- end -%>
  		<%-	end -%>
  		<%- while col_count < element.num_cols do 
  				col_count += 1-%>
  				<td>&nbsp;</td>
  		<%- end unless col_count == 0-%>
  	</tr>
  	</table>
  </li>
<% elsif element.question_grid_id.nil? && element.conditional_id.nil? -%>
  <li>
    <% if element.question? -%>
      <label class="desc"><%= raw element.label %></label>
      <%- if @collating -%>
        <%- for answer_sheet in @collated_answer_sheets[@answer_sheet] -%>
          <div class="answer collate">
            <span class="reviewer_name"><%= answer_sheet.collat_title %>:</span>
            <span class="reviewer_answer"><%= simple_format element.display_response(answer_sheet) %></span>
          </div>
        <%- end -%>
      <%- else -%>
        <span class="answer"><%= simple_format element.display_response(@answer_sheet) %></span>
      <%- end -%>
    <% else -%>
      <%= render :partial => 'questions/' + element.ptemplate, :object => element %>
    <% end -%>
  </li>
<% end -%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fe-0.0.3 app/views/fe/answer_sheets/_element.html.erb