47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
<%
|
|
content_for :title, "Summary - Skills Assessment"
|
|
content_for :footer_title, "Skills Assessment"
|
|
content_for :progress, @status.progress.to_s
|
|
content_for_javascript_once 'summary-edit' do
|
|
javascript_include_tag "summary-edit"
|
|
end
|
|
%>
|
|
|
|
<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>
|
|
|
|
<div>
|
|
<%= link_to('Edit', question_path(question.question_id)) %>
|
|
<button>Save</button>
|
|
<button>Cancel</button>
|
|
</div>
|
|
|
|
<%= image_tag question.attachment if question.attachment.present? %>
|
|
|
|
<fieldset disabled>
|
|
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
|
|
</fieldset>
|
|
|
|
<%= hidden_field_tag 'answer[question_id]', question.question_id %>
|
|
<%= hidden_field_tag 'answer[answer_id]', question.answer_id %>
|
|
<%= hidden_field_tag 'submit', true %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
|
|
<%= 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>
|
|
<% end %>
|
|
<%= submit_tag "Submit all answers", {class: "", disabled: !@status.can_submit } %>
|
|
<% end %>
|