2016-08-08 11:56:42 -05:00
|
|
|
<%
|
|
|
|
content_for :title, "Skills Assessment"
|
|
|
|
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
|
|
|
%>
|
|
|
|
|
2016-07-28 20:54:08 -05:00
|
|
|
<main class="summary_tpl">
|
|
|
|
<h2 class="prft-heading">Almost done!</h2>
|
|
|
|
<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>
|
|
|
|
|
2016-08-04 17:25:12 -05:00
|
|
|
<hr>
|
|
|
|
|
2016-07-30 16:25:09 -05:00
|
|
|
<% @quiz.each do |question| %>
|
2016-08-09 23:17:35 -05:00
|
|
|
<%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: 'summary-form'}) do |form| %>
|
|
|
|
<article class="answer-sec">
|
2016-07-28 20:54:08 -05:00
|
|
|
<div class="question-heading">
|
|
|
|
<div class="question-title">
|
|
|
|
<h3><%= question.question %></h3>
|
|
|
|
</div>
|
|
|
|
<div class="answer-buttons">
|
2016-08-09 23:17:35 -05:00
|
|
|
<a href="<%= question_path(question.question_id) %>" class="tertiary-btn button-edit">Edit</a>
|
2016-07-28 20:54:08 -05:00
|
|
|
<button class="tertiary-btn button-save">Save</button>
|
|
|
|
<button class="tertiary-btn button-cancel">Cancel</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="answer-container">
|
2016-08-04 20:12:14 -05:00
|
|
|
<% if question.attachment.present? %>
|
|
|
|
<%= image_tag question.attachment %>
|
|
|
|
<% end %>
|
|
|
|
|
2016-07-28 20:54:08 -05:00
|
|
|
<fieldset disabled class="answer-block">
|
2016-07-30 16:25:09 -05:00
|
|
|
<%= hidden_field_tag 'answer[question_id]', question.question_id %>
|
2016-08-08 17:08:20 -05:00
|
|
|
<%= hidden_field_tag 'answer[answer_id]', question.answer_id %>
|
2016-08-09 23:17:35 -05:00
|
|
|
<%= hidden_field_tag 'submit', true %>
|
|
|
|
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
|
2016-07-28 20:54:08 -05:00
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</article>
|
2016-08-02 16:27:27 -05:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2016-07-28 20:54:08 -05:00
|
|
|
|
2016-08-10 10:38:20 -05:00
|
|
|
<%= form_tag post_summary_path, id: 'summary-submit', class: "btn-center" do %>
|
|
|
|
<% unless @status.can_submit %>
|
|
|
|
<div class="error">Sorry, you must answer all questions before you can submit.</div>
|
2016-08-02 16:27:27 -05:00
|
|
|
<% end %>
|
2016-08-10 10:38:20 -05:00
|
|
|
<%= submit_tag "Submit all answers", {class: 'submit-button', disabled: !@status.can_submit } %>
|
2016-07-30 16:25:09 -05:00
|
|
|
<% end %>
|
2016-07-28 20:54:08 -05:00
|
|
|
</main>
|