From 4cd1f7c305f7f9031ae050de80c314ff6b38a235 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 26 Mar 2019 11:46:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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] = "课程名称"