生产环境】学生列表的成绩导出,“普通作业1”“试卷1”等更换成作业标题导出

dev_bj
cxt 5 years ago
parent 33bc188023
commit b1290f9f01

@ -2404,17 +2404,17 @@ class CoursesController < ApplicationController
homeworks.where(:homework_type => 4).each do |homework| homeworks.where(:homework_type => 4).each do |homework|
sheet1[4,current_col+=1] = "#{homework.name}" sheet1[4,current_col+=1] = "#{homework.name}"
end end
for i in 0 ... homeworks.where(:homework_type => 1).size homeworks.where(:homework_type => 1).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 => 3).size homeworks.where(:homework_type => 3).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 ... exercises.size exercises.each do |exercise|
sheet1[4,current_col+=1] = "试卷第"+(i+1).to_s+"" sheet1[4,current_col+=1] = "#{exercise.exercise_name}"
end end
for i in 0 ... tasks.size tasks.each do |task|
sheet1[4,current_col+=1] = "毕设任务第"+(i+1).to_s+"" sheet1[4,current_col+=1] = "#{task.name}"
end end
sheet1[4,current_col+=1] = "实训作业总得分" sheet1[4,current_col+=1] = "实训作业总得分"
@ -2598,7 +2598,7 @@ class CoursesController < ApplicationController
end end
homeworks.where(:homework_type => 1).includes(:score_student_works).each_with_index do |home, i| homeworks.where(:homework_type => 1).includes(:score_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] = "课程名称"
@ -2645,7 +2645,7 @@ class CoursesController < ApplicationController
end end
homeworks.where(:homework_type => 3).includes(:score_student_works).each_with_index do |home, i| homeworks.where(:homework_type => 3).includes(:score_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] = "课程名称"
@ -2693,7 +2693,7 @@ class CoursesController < ApplicationController
end end
exercises.includes(:score_exercise_users).each_with_index do |exercise, i| exercises.includes(:score_exercise_users).each_with_index do |exercise, i|
sheet = book.create_worksheet :name => "试卷第#{i+1}" sheet = book.create_worksheet :name => "#{exercise.exercise_name}"
sheet[0,0] = "课程编号" sheet[0,0] = "课程编号"
sheet[0,1] = course.id sheet[0,1] = course.id
sheet[1,0] = "课程名称" sheet[1,0] = "课程名称"
@ -2724,7 +2724,7 @@ class CoursesController < ApplicationController
end end
tasks.each_with_index do |task, i| tasks.each_with_index do |task, i|
sheet = book.create_worksheet :name => "毕设任务第#{i+1}" sheet = book.create_worksheet :name => "#{task.name}"
sheet[0,0] = "课程编号" sheet[0,0] = "课程编号"
sheet[0,1] = course.id sheet[0,1] = course.id
sheet[1,0] = "课程名称" sheet[1,0] = "课程名称"

Loading…
Cancel
Save