导出问卷时,多行主观的答案有html代码
This commit is contained in:
parent
1810a3eb41
commit
2a2b93c97d
|
@ -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(/ /," ")
|
||||||
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(/ /," ")
|
||||||
count_row += 1
|
count_row += 1
|
||||||
end
|
end
|
||||||
count_row += 1
|
count_row += 1
|
||||||
|
|
Loading…
Reference in New Issue