From bc003eecd111c6fc6faecb11dd19781a42468be0 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Mon, 1 Aug 2016 15:16:20 -0500 Subject: [PATCH] updated live coder for attributes --- app/views/candidate/_live_code.html.erb | 13 +++++++++++-- app/views/candidate/live_coder.html.erb | 12 ++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/views/candidate/_live_code.html.erb b/app/views/candidate/_live_code.html.erb index 7690f65..8abd4ec 100644 --- a/app/views/candidate/_live_code.html.erb +++ b/app/views/candidate/_live_code.html.erb @@ -1,3 +1,12 @@ +<% + option_id = "#{question.question_id}_finish-later" + + checkbox_html = {class: 'checkbox', + id: "answer_#{option_id}", + name: "answer[live_code][later]", + checked: Array(question.answer).include?('finish-later') + } +%>
Please revisit this page with JavaScript enabled to modify your answer.
@@ -10,8 +19,8 @@ to acknowledge that you agree to come back at a later time to finish answering this question before you can submit the test.

- - + <%= form.check_box(:answer, checkbox_html, true, '') %> + <%= form.label(option_id, 'I will come back later to finish this live coding question.') %> <% end %> diff --git a/app/views/candidate/live_coder.html.erb b/app/views/candidate/live_coder.html.erb index e78bf2b..df661bb 100644 --- a/app/views/candidate/live_coder.html.erb +++ b/app/views/candidate/live_coder.html.erb @@ -1,16 +1,16 @@
- - + + <%= text_area_tag 'answer[live_code][html]', (@answer['html'] unless @answer.nil?), { 'data-id' => 'code-html', class: 'code-answer code-html' } %>
- - + + <%= text_area_tag 'answer[live_code][css]', (@answer['css'] unless @answer.nil?), { 'data-id' => 'code-css', class: 'code-answer code-css' } %>
- - + + <%= text_area_tag 'answer[live_code][js]', (@answer['js'] unless @answer.nil?), { 'data-id' => 'code-js', class: 'code-answer code-js' } %>
<%= render partial: "candidate/answer_errors", locals: {question: @question, answer: @answer} %>