diff --git a/app/controllers/ec_course_evaluations_controller.rb b/app/controllers/ec_course_evaluations_controller.rb index 52da9c86..58647589 100644 --- a/app/controllers/ec_course_evaluations_controller.rb +++ b/app/controllers/ec_course_evaluations_controller.rb @@ -262,8 +262,8 @@ class EcCourseEvaluationsController < ApplicationController start_column = 0 end - count = @ce.evluation_count * @ce.ec_course_evaluation_subitems.count # 考核次数与分项的笛卡尔积 - for i in 1 .. @ce.evluation_count do + count = (@ce.evluation_count || 1) * (@ce.ec_course_evaluation_subitems.count || 1) # 考核次数与分项的笛卡尔积 + for i in 1 .. (@ce.evluation_count || 1) do @ce.ec_course_evaluation_subitems.each_with_index do |item, j| current_column = start_column + @ce.ec_course_evaluation_subitems.count * (i-1) + j sheet1[1, current_column] = "#{@ce.name}#{i}#{item.name}"