a977c0ceb3
completes #60
16 lines
605 B
Plaintext
16 lines
605 B
Plaintext
<% answers = Array(question.answer) %>
|
|
<%= form.collection_check_boxes(:answer_array, question.input_options, :to_s, :to_s, {}, {class: 'checkbox'}) do | option | %>
|
|
<%
|
|
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
|
|
checked = answers.include?(option.value) ? 'checked' : ''
|
|
%>
|
|
|
|
<div class="form-group-multiples">
|
|
<%= option.check_box( id: option_id, checked: checked, data: { last: checked } ) %>
|
|
<%= option.label(for: option_id) %>
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>
|