diff --git a/app/models/answer.rb b/app/models/answer.rb
index a2a625f..4e8a3e5 100644
--- a/app/models/answer.rb
+++ b/app/models/answer.rb
@@ -87,6 +87,18 @@
return notes.select{ |n| n.archived.blank? }.sort!{ |x,y| y.updated_at <=> x.updated_at }
end
+ ##
+ # Returns True if answer text is blank, false otherwise
+ # specificly we want to remove empty hml tags and check
+ #
+ # @return [Boolean] is the answer's text blank
+ def is_blank?
+ if self.text.present?
+ return self.text.gsub(/<\/?p>/, '').gsub(/
/, '').chomp.blank?
+ end
+ # no text so blank
+ return true
+ end
##
# Returns the parsed JSON hash for the current answer object
diff --git a/app/models/concerns/exportable_plan.rb b/app/models/concerns/exportable_plan.rb
index b9254b8..020d4fb 100644
--- a/app/models/concerns/exportable_plan.rb
+++ b/app/models/concerns/exportable_plan.rb
@@ -56,15 +56,7 @@
phase.sections.each do |section|
sctn = { title: section.title, number: section.number, questions: [] }
section.questions.each do |question|
- txt = []
- if question.question_format.option_based?
- opts = QuestionOption.where(question_id: question.id)
- opts.each do |opt|
- txt << opt.text
- end
- else
- txt << question.text
- end
+ txt = question.text
sctn[:questions] << { id: question.id, text: txt, format: question.question_format }
end
phs[:sections] << sctn
diff --git a/app/views/shared/export/_plan.erb b/app/views/shared/export/_plan.erb
index e3e5772..d6db153 100644
--- a/app/views/shared/export/_plan.erb
+++ b/app/views/shared/export/_plan.erb
@@ -19,7 +19,7 @@
<%= raw question[:text][0].gsub(/
<%= raw question[:text].gsub(/
<%= _('Question not answered.') -%>
- <% elsif !blank %> + <% else %> + <%# case where Question has options %> <% if options.present?%><%= raw ah['text'] %>
- <% else %> -<%= raw answer.text.chomp.strip %>
+ <%# case for displaying comments OR text %> + <% elsif !blank %> +<%= raw answer.text %>
<% end %> <% end %>