fixes #40 - summary noJS messages

This commit is contained in:
Mark Moser
2016-08-04 22:28:20 -05:00
parent 5d906c6ff4
commit 8640effbfc
4 changed files with 32 additions and 26 deletions

View File

@ -1,4 +1,4 @@
<% if flash[:answer_error] == question.question_id %>
<% if flash[:answer_error] == question.question_id && answer.present? %>
<% answer.errors.messages[:answer].each do |message| %>
<div class="error"><%= message %></div>
<% end %>

View File

@ -11,18 +11,22 @@
Please revisit this page with JavaScript enabled to modify your answer.
</div> -->
<% unless params[:action] == 'summary' %>
<div data-id="live-coder-finish-later">
<p class="warning">
This is a question where you will be asked to write code, and it utilizes a JavaScript-enabled
environment. It looks like JavaScript is not loaded. Please check the box below
to acknowledge that you agree to come back at a later time to finish answering this question
before you can submit the test.
</p>
<div data-id="live-coder-finish-later">
<p class="warning">
This is a question where you will be asked to write code, and it utilizes a JavaScript-enabled
environment. It looks like JavaScript is not loaded.
<% unless params[:action] == 'summary' %>
Please check the box below to acknowledge that you agree to come back at a later time to finish
answering this question before you can submit the test.
<% else %>
You will need to enable JavaScript and answer this question before you can submit the test.
<% end %>
</p>
<% unless params[:action] == 'summary' %>
<%= form.check_box(:answer, checkbox_html, true, '') %>
<%= form.label(option_id, 'I will come back later to finish this code question') %>
</div>
<% end %>
<% end %>
</div>
<div data-id="live-coder-answer">
<% # answers inserted dynamically via jQuery .load()

View File

@ -15,7 +15,7 @@
<h3><%= question.question %></h3>
</div>
<div class="answer-buttons">
<a href="<%= question_path(question.question_id) %>" class="tertiary-btn button-edit" data-questionId="<%= question.question_id %>">Edit</a>
<a href="<%= question_path(question.question_id) %>" class="tertiary-btn button-edit" data-answerId="<%= question.answer_id %>" data-questionId="<%= question.question_id %>">Edit</a>
<button class="tertiary-btn button-save">Save</button>
<button class="tertiary-btn button-cancel">Cancel</button>
</div>