diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 5e8f7b67e..a9843a5cc 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -200,7 +200,7 @@ class HomeworkCommonsController < ApplicationController if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") else - if @work_excel.size > 0 + if @work_excel.present? student_work_to_xlsx(@work_excel,@homework) exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S') render xlsx: "#{exercise_export_name.strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: