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

47 lines
1.5 KiB
Plaintext
Raw Normal View History

<%
2016-11-22 16:59:54 -06:00
content_for :title, "Summary - 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
%>
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>
<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 %>
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 %>