2016-09-02 17:51:35 -05:00
|
|
|
<% answer = answer.try(:answer) || answer %>
|
|
|
|
<%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: 'radio'}) do | option | %>
|
|
|
|
<%
|
|
|
|
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
|
|
|
|
checked = answer == option.value ? 'checked' : ''
|
|
|
|
%>
|
|
|
|
|
2016-08-09 23:17:35 -05:00
|
|
|
<div class="form-group-multiples">
|
2016-09-02 17:51:35 -05:00
|
|
|
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
|
|
|
|
<%= option.label(for: option_id) %>
|
2016-08-09 23:17:35 -05:00
|
|
|
</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} %>
|