|
|
|
@ -213,7 +213,6 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.xlsx{
|
|
|
|
|
cookies[:fileDownload] = true
|
|
|
|
|
cookies[: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:
|
|
|
|
@ -237,7 +236,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
if status == 0
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.zip{
|
|
|
|
|
cookies.signed[:fileDownload] = { value: true, httponly: false }
|
|
|
|
|
cookies[:fileDownload] = true
|
|
|
|
|
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'
|
|
|
|
|