|
|
@ -2390,8 +2390,8 @@ class CoursesController < ApplicationController
|
|
|
|
sheet1[4,3] = "学号"
|
|
|
|
sheet1[4,3] = "学号"
|
|
|
|
sheet1[4,4] = "分班"
|
|
|
|
sheet1[4,4] = "分班"
|
|
|
|
current_col = 4
|
|
|
|
current_col = 4
|
|
|
|
for i in 0 ... homeworks.where(:homework_type => 4).count
|
|
|
|
homeworks.where(:homework_type => 4).each do |homework|
|
|
|
|
sheet1[4,current_col+=1] = "实训作业第"+(i+1).to_s+"次"
|
|
|
|
sheet1[4,current_col+=1] = "#{homework.name}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
for i in 0 ... homeworks.where(:homework_type => 1).count
|
|
|
|
for i in 0 ... homeworks.where(:homework_type => 1).count
|
|
|
|
sheet1[4,current_col+=1] = "普通作业第"+(i+1).to_s+"次"
|
|
|
|
sheet1[4,current_col+=1] = "普通作业第"+(i+1).to_s+"次"
|
|
|
@ -2551,7 +2551,7 @@ class CoursesController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
homeworks.where(:homework_type => 4).includes(:student_works).each_with_index do |home, i|
|
|
|
|
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,0] = "课程编号"
|
|
|
|
sheet[0,1] = course.id
|
|
|
|
sheet[0,1] = course.id
|
|
|
|
sheet[1,0] = "课程名称"
|
|
|
|
sheet[1,0] = "课程名称"
|
|
|
|