导出问卷时,多行主观的答案有html代码

This commit is contained in:
sw 2015-06-12 16:58:43 +08:00
parent 1810a3eb41
commit 2a2b93c97d
1 changed files with 2 additions and 2 deletions

View File

@ -464,7 +464,7 @@ class PollController < ApplicationController
sheet1[count_row + 1,0] = l(:label_poll_subtotal) sheet1[count_row + 1,0] = l(:label_poll_subtotal)
sheet1[count_row + 2,0] = l(:label_poll_proportion) sheet1[count_row + 2,0] = l(:label_poll_proportion)
poll_question.poll_answers.each_with_index do |poll_answer,i| poll_question.poll_answers.each_with_index do |poll_answer,i|
sheet1[count_row, i + 1] = poll_answer.answer_text sheet1[count_row, i + 1] = poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")
sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count sheet1[count_row + 1, i + 1] = poll_answer.poll_votes.count
sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%" sheet1[count_row + 2, i + 1] = statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)).to_s + "%"
end end
@ -477,7 +477,7 @@ class PollController < ApplicationController
sheet1[count_row,1] = poll_question.question_title sheet1[count_row,1] = poll_question.question_title
count_row += 1 count_row += 1
poll_question.poll_votes.each do |poll_vote| poll_question.poll_votes.each do |poll_vote|
sheet1[count_row,0] = poll_vote.vote_text sheet1[count_row,0] = poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")
count_row += 1 count_row += 1
end end
count_row += 1 count_row += 1