skill-assessment-app/app/views/admin/question/view.html.erb

41 lines
1.0 KiB
Plaintext
Raw Normal View History

2016-08-19 16:02:18 -05:00
<%
content_for :section_title, "Question for #{@question.quiz.name}"
%>
2016-08-24 12:17:00 -05:00
<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>
2016-08-19 16:02:18 -05:00
2016-08-24 12:17:00 -05:00
<strong>Question</strong>
<p><%= @question.question %></p>
2016-08-19 16:02:18 -05:00
<% if @question.attachment.present? %>
<p><%= image_tag @question.attachment %></p>
<% end %>
2016-08-24 12:17:00 -05:00
<%= fields_for @question do |fields| %>
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
<% end %>
2016-08-19 16:02:18 -05:00
2016-08-24 12:17:00 -05:00
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>
2016-08-24 12:17:00 -05:00
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>