在导出的Excel中,如果用户填写了其它,则应该在下方的列表中记录“其它(我录入的其它回复)”

This commit is contained in:
cxt 2016-12-16 17:27:24 +08:00
parent d8f098c6f4
commit a67d809168
2 changed files with 4 additions and 3 deletions

View File

@ -804,7 +804,7 @@ class PollController < ApplicationController
current_index = 1
poll_questions.each_with_index do |poll_question, i|
if poll_question.question_type == 1 || poll_question.question_type == 2
sheet1[count_row ,current_index] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ") if poll_vote.poll_answer}.join(";")
sheet1[count_row ,current_index] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| (poll_vote.vote_text.nil? ? poll_vote.poll_answer.answer_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ") : l(:label_other_answer) + " (" + poll_vote.vote_text.to_s + ") ") if poll_vote.poll_answer}.join(";")
current_index += 1
elsif poll_question.question_type == 3
sheet1[count_row ,current_index] = user.poll_votes.where(:poll_question_id => poll_question.id).map{|poll_vote| poll_vote.vote_text.gsub(/<\/?.*?>/,"").gsub(/&nbsp;/," ")}.join(";")

View File

@ -105,6 +105,7 @@ zh:
label_user_name: "用户名称"
#setting end
label_course_poll: 课程问卷
label_course_poll: "课程问卷"
label_other_answer: "其他"
label_homework_committed: 你已经提交过作品,如果你想修改作品的话,可以在作品列表页面对作品信息进行修改。
label_homework_committed: "你已经提交过作品,如果你想修改作品的话,可以在作品列表页面对作品信息进行修改。"