skill-assessment-app/app/views/quiz/question.html.erb

27 lines
992 B
Plaintext
Raw Normal View History

2016-07-27 22:16:12 -05:00
<%
content_for :title, "Skills Assessment"
content_for :category, @question.category
content_for :footer_title, "Skills Assessment"
content_for :progress, @status.progress.to_s
2016-07-27 22:16:12 -05:00
%>
2016-07-28 08:22:05 -05:00
2017-05-03 13:22:22 -05:00
<%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, class: 'form-question', data: {qid: @question.question_id}}) do |form| %>
2017-04-17 14:50:32 -05:00
<h1><%= @question.question %></h1>
<% if @question.attachment.present? %>
2017-05-03 13:22:22 -05:00
<figure><%= image_tag @question.attachment%></figure>
2017-04-17 14:50:32 -05:00
<% end %>
2016-08-03 08:55:30 -05:00
2017-03-20 10:57:50 -05:00
<%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %>
2016-07-27 22:16:12 -05:00
2017-03-20 10:57:50 -05:00
<% if @status.on_summary %>
<button type="submit" name="submit">Save and return to summary</button>
<% else %>
<button type="submit" name="save">Save</button>
<button type="submit" name="submit">Next &rarr;</button>
<% end %>
2016-07-27 22:16:12 -05:00
2017-03-20 10:57:50 -05:00
<%= hidden_field_tag 'answer[question_id]', @question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', @question.answer_id %>
2016-07-28 08:47:34 -05:00
<% end %>