|
|
|
@ -53,8 +53,8 @@ module ZipService
|
|
|
|
|
exercise_users.each_with_index do |exercise_user, index|
|
|
|
|
|
member = members.where(:user_id => exercise_user.user_id).first
|
|
|
|
|
group_name = member.try(:course_group_id).to_i == 0 ? '未分班' : member.course_group.name
|
|
|
|
|
# export_file_name = "#{group_name}-#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
|
|
|
|
|
export_file_name = "#{exercise.id}-#{exercise_user.user.user_extensions.student_id}-#{index}" + ".pdf"
|
|
|
|
|
export_file_name = "#{group_name}-#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
|
|
|
|
|
# export_file_name = "#{exercise.id}-#{exercise_user.user.user_extensions.student_id}-#{index}" + ".pdf"
|
|
|
|
|
out_file = export_user_exercise(exercise, exercise_user, export_file_name)
|
|
|
|
|
file_name = File::expand_path(out_file)
|
|
|
|
|
|
|
|
|
@ -190,10 +190,9 @@ module ZipService
|
|
|
|
|
# file_name = "#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
|
|
|
|
|
# file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{exercise.course_id}-#{exercise.id}-#{exercise_user.user.user_extensions.student_id}" + ".pdf"
|
|
|
|
|
file_name.gsub!(" ", "-")
|
|
|
|
|
Rails.logger.info("###################file_name: #{file_name}")
|
|
|
|
|
file_name.gsub!("/", "-")
|
|
|
|
|
kit.to_file("#{OUTPUT_FOLDER}/#{file_name}")
|
|
|
|
|
out_file = "#{OUTPUT_FOLDER}/#{file_name}"
|
|
|
|
|
Rails.logger.info("#################out_file_file_name: #{out_file}")
|
|
|
|
|
out_file
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|