diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 3eb0364e9..f265292ab 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -201,13 +201,14 @@ class HomeworkCommonsController < ApplicationController tip_exception(403, "无权限操作") else if @work_excel.present? + Rails.logger.info("############_____________@work_excel_________###############{@work_excel.size}") + Rails.logger.info("############_____________@homework_________###############{@homework.id}") 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') + Rails.logger.info("############_____________exercise_export_name_________###############{exercise_export_name}") + render xlsx: "#{exercise_export_name.strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals: {table_columns: @work_head_cells,task_users: @work_cells_column} - Rails.logger.info("############_____________@work_head_cells_________###############{@work_head_cells}") - Rails.logger.info("############_____________@work_cells_column_________###############{@work_cells_column}") - else normal_status(-1,"暂无提交的学生!") end diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index af883131a..3a66c9dff 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -104,6 +104,8 @@ module ExportHelper @work_cells_column.push(row_cells_column) end else #实训题 + Rails.logger.info("############_____________homework.homework_type_________###############{homework.homework_type}") + shixun = homework.shixuns.first shixun_head_cells = %w(完成情况 通关时间 总耗时 总评测次数 获得经验值 关卡得分) eff_boolean = homework.work_efficiency