diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c7909c94..43b0076f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2390,8 +2390,8 @@ class CoursesController < ApplicationController sheet1[4,3] = "学号" sheet1[4,4] = "分班" current_col = 4 - for i in 0 ... homeworks.where(:homework_type => 4).count - sheet1[4,current_col+=1] = "实训作业第"+(i+1).to_s+"次" + homeworks.where(:homework_type => 4).each do |homework| + sheet1[4,current_col+=1] = "#{homework.name}" end for i in 0 ... homeworks.where(:homework_type => 1).count sheet1[4,current_col+=1] = "普通作业第"+(i+1).to_s+"次" @@ -2551,7 +2551,7 @@ class CoursesController < ApplicationController end homeworks.where(:homework_type => 4).includes(:student_works).each_with_index do |home, i| - sheet = book.create_worksheet :name => "实训作业第#{i+1}次" + sheet = book.create_worksheet :name => "#{home.name}" sheet[0,0] = "课程编号" sheet[0,1] = course.id sheet[1,0] = "课程名称"