|
|
@ -418,7 +418,7 @@ module ExportHelper
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
out_file_name = "#{Time.now.to_i}_#{homework_common.name}.zip"
|
|
|
|
out_file_name = "作品附件_#{homework_common&.course&.name}_#{homework_common.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip"
|
|
|
|
out_file_name.gsub!(" ", "-")
|
|
|
|
out_file_name.gsub!(" ", "-")
|
|
|
|
out_file_name.gsub!("/", "_")
|
|
|
|
out_file_name.gsub!("/", "_")
|
|
|
|
out_file = find_or_pack(homework_common, homework_common.user_id, digests.sort){
|
|
|
|
out_file = find_or_pack(homework_common, homework_common.user_id, digests.sort){
|
|
|
@ -496,8 +496,8 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
|
|
def make_zip_name(work, file_name="")
|
|
|
|
def make_zip_name(work, file_name="")
|
|
|
|
Rails.logger.info("######################file_name: #{file_name}")
|
|
|
|
Rails.logger.info("######################file_name: #{file_name}")
|
|
|
|
name = file_name === "" ? "" : (file_name[0, file_name.rindex('.')]+"_")
|
|
|
|
# name = file_name === "" ? "" : (file_name[0, file_name.rindex('.')]+"_")
|
|
|
|
"#{name}#{work.user.real_name}_#{((work.user.student_id.nil?) ? "" : work.user.student_id)}"
|
|
|
|
"#{work&.user&.student_id}_#{work.&user.&real_name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
|
|
|
|
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[])
|
|
|
|