2017-04-17 16:40:08 -05:00
|
|
|
<% answer_string = answer.try(:answer) || answer %>
|
2017-03-20 10:57:50 -05:00
|
|
|
<%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %>
|
2017-04-17 16:19:54 -05:00
|
|
|
<%
|
|
|
|
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
|
|
|
|
checked = answer_string == option.value ? 'checked' : ''
|
|
|
|
%>
|
|
|
|
|
|
|
|
<div class="">
|
|
|
|
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
|
|
|
|
<%= option.label(for: option_id) %>
|
|
|
|
</div>
|
2016-09-02 17:51:35 -05:00
|
|
|
|
2016-07-28 20:54:08 -05:00
|
|
|
<% end %>
|
2016-07-27 22:16:12 -05:00
|
|
|
|
2016-08-08 17:08:20 -05:00
|
|
|
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>
|