From b1290f9f01d4fa326f3988640bd11548609dc421 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 1 Jul 2019 14:04:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E3=80=91?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8=E7=9A=84=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=EF=BC=8C=E2=80=9C=E6=99=AE=E9=80=9A=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A1=E2=80=9D=E2=80=9C=E8=AF=95=E5=8D=B71=E2=80=9D?= =?UTF-8?q?=E7=AD=89=E6=9B=B4=E6=8D=A2=E6=88=90=E4=BD=9C=E4=B8=9A=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a850d16c..a35860f2 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2404,17 +2404,17 @@ class CoursesController < ApplicationController 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).size - sheet1[4,current_col+=1] = "普通作业第"+(i+1).to_s+"次" + homeworks.where(:homework_type => 1).each do |homework| + sheet1[4,current_col+=1] = "#{homework.name}" end - for i in 0 ... homeworks.where(:homework_type => 3).size - sheet1[4,current_col+=1] = "分组作业第"+(i+1).to_s+"次" + homeworks.where(:homework_type => 3).each do |homework| + sheet1[4,current_col+=1] = "#{homework.name}" end - for i in 0 ... exercises.size - sheet1[4,current_col+=1] = "试卷第"+(i+1).to_s+"次" + exercises.each do |exercise| + sheet1[4,current_col+=1] = "#{exercise.exercise_name}" end - for i in 0 ... tasks.size - sheet1[4,current_col+=1] = "毕设任务第"+(i+1).to_s+"次" + tasks.each do |task| + sheet1[4,current_col+=1] = "#{task.name}" end sheet1[4,current_col+=1] = "实训作业总得分" @@ -2598,7 +2598,7 @@ class CoursesController < ApplicationController end 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,1] = course.id sheet[1,0] = "课程名称" @@ -2645,7 +2645,7 @@ class CoursesController < ApplicationController end 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,1] = course.id sheet[1,0] = "课程名称" @@ -2693,7 +2693,7 @@ class CoursesController < ApplicationController end 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,1] = course.id sheet[1,0] = "课程名称" @@ -2724,7 +2724,7 @@ class CoursesController < ApplicationController end 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,1] = course.id sheet[1,0] = "课程名称"