skill-assessment-app/app/views/quiz/question.html.erb
2017-06-05 11:30:35 -05:00

27 lines
992 B
Plaintext

<%
content_for :title, "Skills Assessment"
content_for :category, @question.category
content_for :footer_title, "Skills Assessment"
content_for :progress, @status.progress.to_s
%>
<%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, class: 'form-question', data: {qid: @question.question_id}}) do |form| %>
<h1><%= @question.question %></h1>
<% if @question.attachment.present? %>
<figure><%= image_tag @question.attachment%></figure>
<% end %>
<%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %>
<% 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 %>
<%= hidden_field_tag 'answer[question_id]', @question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', @question.answer_id %>
<% end %>