<%
  content_for :section_title, "Question for #{@question.quiz.name}"
%>

<table cellspacing="0" cellpadding="0">
  <tr>
    <th>Category</th>
    <td><%= @question.category %></td>
  </tr>
  <tr>
    <th>Type</th>
    <td><%= @question.input_type %></td>
  </tr>
  <tr>
    <th>Sort</th>
    <td><%= @question.sort %></td>
  </tr>
  <tr>
    <th></th>
    <td>
      <%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
      <%= label_tag 'question_active', 'Active' %>
    </td>
  </tr>
</table>

<strong>Question</strong>
<p><%= @question.question %></p>

<% if @question.attachment.present? %>
  <p><%= image_tag @question.attachment %></p>
<% end %>

<%= fields_for @question do |fields| %>
  <%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
<% end %>

<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>

<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>
