|
|
@ -207,12 +207,11 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
format.xlsx{
|
|
|
|
format.xlsx{
|
|
|
|
student_work_to_xlsx(@work_excel,@homework)
|
|
|
|
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')
|
|
|
|
exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S')
|
|
|
|
|
|
|
|
response.set_header("Content-Disposition","attachment; filename=#{exercise_export_name.strip.first(30)}};filename*=utf-8''#{exercise_export_name.strip.first(30)}}")
|
|
|
|
render xlsx: "#{exercise_export_name.encode(Encoding.default_external,"UTF-8", :invalid => :replace, :undef => :replace, :replace => " ").strip.first(30)}",template: "homework_commons/works_list.xlsx.axlsx",locals:
|
|
|
|
# response.setHeader['Content-Disposition'] = "attachment; filename=\"#{exercise_export_name.strip.first(30)}\""
|
|
|
|
|
|
|
|
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}
|
|
|
|
{table_columns: @work_head_cells,task_users: @work_cells_column}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# .encode(Encoding.default_external, 'gb2312')
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
elsif params[:format] == "zip"
|
|
|
|
elsif params[:format] == "zip"
|
|
|
@ -1344,7 +1343,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 代码查重详情
|
|
|
|
# 代码查重代码的详情
|
|
|
|
def code_review_detail
|
|
|
|
def code_review_detail
|
|
|
|
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
|
|
|
|
@student_work = @homework.student_works.find_by(user_id: params[:user_id])
|
|
|
|
@user = @student_work.user
|
|
|
|
@user = @student_work.user
|
|
|
|