|
|
@ -1,7 +1,7 @@
|
|
|
|
class ExportExercisesService
|
|
|
|
class ExportExercisesService
|
|
|
|
include ExercisesHelper
|
|
|
|
include ExercisesHelper
|
|
|
|
include StudentWorksHelper
|
|
|
|
include StudentWorksHelper
|
|
|
|
attr_reader :exercise, :ex_users
|
|
|
|
attr_reader :exercise, :ex_users, :request_url
|
|
|
|
|
|
|
|
|
|
|
|
def initialize(exercise, ex_users, request_url)
|
|
|
|
def initialize(exercise, ex_users, request_url)
|
|
|
|
@exercise = exercise
|
|
|
|
@exercise = exercise
|
|
|
@ -19,7 +19,7 @@ class ExportExercisesService
|
|
|
|
pdfs = []
|
|
|
|
pdfs = []
|
|
|
|
Zip::File.open(zip_file.path, Zip::File::CREATE) do |zip|
|
|
|
|
Zip::File.open(zip_file.path, Zip::File::CREATE) do |zip|
|
|
|
|
ex_users.each do |ex_user|
|
|
|
|
ex_users.each do |ex_user|
|
|
|
|
export = ExerciseUserPdfService.new(exercise, ex_user,request_url)
|
|
|
|
export = ExerciseUserPdfService.new(exercise, ex_user,@request_url)
|
|
|
|
pdf = export.ex_pdf
|
|
|
|
pdf = export.ex_pdf
|
|
|
|
pdfs << pdf
|
|
|
|
pdfs << pdf
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|