+
+ <% if question.option_based? %>
+ <%= f.label raw(question.text), for: :question_option_ids, class: "no-colon" %>
+ <% else %>
+ <%= f.label raw(question.text), for: :text, class: "no-colon" %>
+ <% end %>
+
+
+ <% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %>
+ <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %>
+ <% if annotation.text.present? %>
+
+
+ <%="#{annotation.org.abbreviation} "%> <%=_('Example of answer')%>
+
-
- <% if !readonly && question.annotations.where(type: Annotation.types[:example_answer]).any? %>
- <% annotation = question.annotations.where(type: Annotation.types[:example_answer]).order(:created_at).first %>
- <% if annotation.text.present? %>
-
-
- <%="#{annotation.org.abbreviation} "%> <%=_('Example of answer')%>
-
+
+
<%= raw annotation.text %>
+
+
+ <% end %>
+ <% end %>
-
-
- <%= raw annotation.text %>
-
-
-
- <% end %>
- <% end %>
+ <% if question.option_based? %>
+ <% options = question.question_options.by_number %>
+ <% if q_format.checkbox? %>
+
+ <% options.each do |op| %>
+ -
+ <%= f.check_box(:question_option_ids, { multiple: true, checked: answer.has_question_option(op.id), disabled: readonly }, op.id, nil) %>
+ <%= raw op.text %>
+
+ <% end %>
+
+ <% elsif q_format.radiobuttons? %>
+
+ <% options.each do |op| %>
+ -
+ <%= f.radio_button :question_option_ids, op.id, { checked: answer.has_question_option(op.id), id: "answer_option_ids_#{op.id}", disabled: readonly } %>
+ <%= raw op.text %>
+
+ <% end %>
+
+ <% elsif q_format.dropdown? || q_format.multiselectbox? %>
+ <%
+ options_html = ""
+ options.each do |op|
+ options_html += answer.has_question_option(op.id) ?
+ "
" :
+ "
"
+ end
+ %>
+ <%= select_tag('answer[question_option_ids]', raw(options_html),
+ {multiple: q_format.multiselectbox?, include_blank: q_format.dropdown?, disabled: readonly }) %>
+ <% end %>
+
+ <% if question.option_comment_display == true %>
+ <%= label_tag('answer[text]', _('Comment')) %>
+ <% if readonly %>
+
<%= raw(answer.text) %>
+ <% else %>
+ <%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
+ <%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
+ <% end %>
+ <%end%>
- <% if question.option_based? %>
- <% options = question.question_options.by_number %>
- <% if q_format.checkbox? %>
-
- <% options.each do |op| %>
- -
- <%= f.check_box(:question_option_ids, { multiple: true, checked: answer.has_question_option(op.id), disabled: readonly }, op.id, nil) %>
- <%= raw op.text %>
-
- <% end %>
-
- <% elsif q_format.radiobuttons? %>
-
- <% options.each do |op| %>
- -
- <%= f.radio_button :question_option_ids, op.id, { checked: answer.has_question_option(op.id), id: "answer_option_ids_#{op.id}", disabled: readonly } %>
- <%= raw op.text %>
-
- <% end %>
-
- <% elsif q_format.dropdown? || q_format.multiselectbox? %>
- <%
- options_html = ""
- options.each do |op|
- options_html += answer.has_question_option(op.id) ?
- "
" :
- "
"
- end
- %>
- <%= select_tag('answer[question_option_ids]', raw(options_html),
- {multiple: q_format.multiselectbox?, include_blank: q_format.dropdown?, disabled: readonly }) %>
- <% end %>
-
- <% if question.option_comment_display == true %>
- <%= label_tag('answer[text]', _('Comment')) %>
- <% if readonly %>
-
<%= raw(answer.text) %>
- <% else %>
- <%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
- <%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
- <% end %>
- <%end%>
- <% end %>
-
- <% if q_format.textfield? %>
- <% if readonly %>
-
<%= strip_tags(answer.text) %>
- <% else %>
- <%= text_field_tag('answer[text]', strip_tags(answer.text)) %>
- <% end %>
- <% elsif q_format.textarea? %>
- <% if readonly %>
-
<%= raw(answer.text) %>
- <% else %>
- <%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
- <%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
- <% end %>
- <% end %>
+
+ <% elsif q_format.textfield? %>
+ <% if readonly %>
+
<%= strip_tags(answer.text) %>
+ <% else %>
+ <%= text_field_tag('answer[text]', strip_tags(answer.text)) %>
+ <% end %>
+
+ <% elsif q_format.textarea? %>
+ <% if readonly %>
+
<%= raw(answer.text) %>
+ <% else %>
+ <%= text_area_tag('answer[text]', answer.text, id: "answer-text-#{question.id}") %>
+ <%= tinymce(selector: "#answer-text-#{question.id}", setup: "$.fn.tinymce_answer_events", content_css: asset_path('application.css')) %>
+ <% end %>
+ <% end %>
- <% if !readonly %>
-
- <% end %>
-
- <% end %>
\ No newline at end of file
+
+
+ <% if !readonly %>
+