master
SylorHuang 5 years ago
parent 2fbcd9928a
commit 7f8e1acd9d

@ -212,10 +212,11 @@ class HomeworkCommonsController < ApplicationController
else
respond_to do |format|
format.xlsx{
cookies.signed[:fileDownload] = { value: true, httponly: false }
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}",template: "homework_commons/works_list.xlsx.axlsx",locals:
{table_columns: @work_head_cells,task_users: @work_cells_column},cookies:{fileDownload:true,HttpOnly:false}
{table_columns: @work_head_cells,task_users: @work_cells_column}
}
end
end
@ -235,9 +236,10 @@ class HomeworkCommonsController < ApplicationController
if status == 0
respond_to do |format|
format.zip{
cookies.signed[:fileDownload] = { value: true, httponly: false }
zipfile = zip_homework_common @homework, zip_works
file = decode64(zipfile[0][:base64file])
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip',cookies:{fileDownload:true,HttpOnly:false}
send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
}
end
else

Loading…
Cancel
Save