diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 325517e4b..5059f5857 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -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(/ /," ") 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(/ /," ") : 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(/ /," ")}.join(";") diff --git a/config/locales/courses/zh.yml b/config/locales/courses/zh.yml index ac7e1b4a3..3cecad728 100644 --- a/config/locales/courses/zh.yml +++ b/config/locales/courses/zh.yml @@ -105,6 +105,7 @@ zh: label_user_name: "用户名称" #setting end - label_course_poll: 课程问卷 + label_course_poll: "课程问卷" + label_other_answer: "其他" - label_homework_committed: 你已经提交过作品,如果你想修改作品的话,可以在作品列表页面对作品信息进行修改。 \ No newline at end of file + label_homework_committed: "你已经提交过作品,如果你想修改作品的话,可以在作品列表页面对作品信息进行修改。" \ No newline at end of file