|
|
|
@ -200,10 +200,15 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
if @user_course_identity >= Course::STUDENT
|
|
|
|
|
tip_exception(403, "无权限操作")
|
|
|
|
|
else
|
|
|
|
|
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:
|
|
|
|
|
{table_columns: @work_head_cells,task_users: @work_cells_column}
|
|
|
|
|
if @work_excel.size > 0
|
|
|
|
|
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:
|
|
|
|
|
{table_columns: @work_head_cells,task_users: @work_cells_column}
|
|
|
|
|
else
|
|
|
|
|
normal_status(-1,"暂无提交的学生!")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
format.zip{
|
|
|
|
|