pre_develop
cxt 6 years ago
parent bf178e6647
commit 1f3cf342ba

@ -50,11 +50,10 @@ module ZipService
bid_homework_path = []
digests = []
members = exercise.course.members
exercise_users.each_with_index do |exercise_user, index|
exercise_users.each do |exercise_user|
member = members.where(:user_id => exercise_user.user_id).first
group_name = member.try(:course_group_id).to_i == 0 ? '未分班' : member.course_group.try(: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.course_id}-#{index+1}" + ".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"
out_file = export_user_exercise(exercise, exercise_user, export_file_name)
file_name = File::expand_path(out_file)

Loading…
Cancel
Save