%
option_id = "#{question.question_id}_finish-later"
checkbox_html = {class: 'checkbox',
id: "answer_#{option_id}",
name: "answer[#{question.input_type}][later]",
checked: Array(question.answer).include?('finish-later')
}
answers = answer.try(:answer) || answer
value_text = answers['text'] || question.input_options['text']
value_html = answers['html'] || question.input_options['html']
value_css = answers['css'] || question.input_options['css']
value_js = answers['js'] || question.input_options['js']
%>
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>
<%= text_area_tag 'answer[live_code][text]', value_text, { disabled: true, data: {last: answers['text']}} %>
<%= text_area_tag 'answer[live_code][html]', value_html, { disabled: true, data: {id: 'code-html', last: answers['html']}, class: 'code-answer code-html' } %>
<%= text_area_tag 'answer[live_code][css]', value_css, { disabled: true, data: {id: 'code-css', last: answers['css']}, class: 'code-answer code-css' } %>
<%= text_area_tag 'answer[live_code][js]', value_js, { disabled: true, data: {id: 'code-js', last: answers['js']}, class: 'code-answer code-js' } %>