2016-08-08 11:56:42 -05:00
|
|
|
<%
|
2016-11-22 16:59:54 -06:00
|
|
|
content_for :title, "Summary - Skills Assessment"
|
2016-08-08 11:56:42 -05:00
|
|
|
content_for :footer_title, "Skills Assessment"
|
|
|
|
content_for :progress, @status.progress.to_s
|
2016-09-07 17:45:22 -05:00
|
|
|
content_for_javascript_once 'summary-edit' do
|
|
|
|
javascript_include_tag "summary-edit"
|
|
|
|
end
|
2016-08-08 11:56:42 -05:00
|
|
|
%>
|
|
|
|
|
2017-03-20 10:57:50 -05:00
|
|
|
<h1>Almost done!</h1>
|
|
|
|
<p>
|
|
|
|
Now's the time to review your answers and go back and change any, if you need to.
|
|
|
|
Once you're done, hit the button at the bottom of the page to submit your answers.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<% @quiz.each do |question| %>
|
|
|
|
<%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: ""}) do |form| %>
|
|
|
|
<h2><%= question.question %></h2>
|
|
|
|
|
2017-04-17 14:50:32 -05:00
|
|
|
<% if question.attachment.present? %>
|
|
|
|
<figure>
|
|
|
|
<%= image_tag question.attachment %>
|
|
|
|
</figure>
|
|
|
|
<% end %>
|
2017-03-20 10:57:50 -05:00
|
|
|
|
|
|
|
<fieldset disabled>
|
|
|
|
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
|
|
|
|
</fieldset>
|
|
|
|
|
2017-04-17 14:50:32 -05:00
|
|
|
<ul class="summary-question-controls">
|
|
|
|
<li><%= link_to('Edit', question_path(question.question_id)) %></li>
|
|
|
|
<li><button>Save</button></li>
|
|
|
|
<li><button>Cancel</button></li>
|
|
|
|
</ul>
|
|
|
|
|
2017-04-18 17:15:38 -05:00
|
|
|
<%= hidden_field_tag 'answer[question_id]', question.question_id, id: "answer_question_id_#{question.question_id}" %>
|
|
|
|
<%= hidden_field_tag 'answer[answer_id]', question.answer_id, id: "answer_answer_id_#{question.question_id}" %>
|
|
|
|
<%= hidden_field_tag 'submit', true, id: "submit_#{question.question_id}"%>
|
2016-08-02 16:27:27 -05:00
|
|
|
<% end %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<% end %>
|
|
|
|
|
2016-07-28 20:54:08 -05:00
|
|
|
|
2017-03-20 10:57:50 -05:00
|
|
|
<%= form_tag post_summary_path, id: 'summary-submit', class: "" do %>
|
|
|
|
<% unless @status.can_submit %>
|
|
|
|
<div class="error">Sorry, you must answer all questions before you can submit.</div>
|
2016-07-30 16:25:09 -05:00
|
|
|
<% end %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<%= submit_tag "Submit all answers", {class: "", disabled: !@status.can_submit } %>
|
|
|
|
<% end %>
|