Class: Course::Assessment::Submission::ZipDownloadJob

Inherits:
ApplicationJob
  • Object
show all
Includes:
TrackableJob
Defined in:
app/jobs/course/assessment/submission/zip_download_job.rb

Instance Attribute Summary

Attributes included from TrackableJob

#job

Instance Method Summary collapse

Methods included from TrackableJob

#initialize, #job_id=, #perform, #rescue_tracked, #wait

Instance Method Details

#perform_tracked(course_user, assessment, students = nil) ⇒ Object (protected)

Performs the download service.

Parameters:

  • course_user (CourseUser)

    The course user downloading the submissions.

  • assessment (Course::Assessment)

    The assessments to download submissions for.

  • students (String|nil) (defaults to: nil)

    The subset of students whose submissions to download.


13
14
15
16
17
# File 'app/jobs/course/assessment/submission/zip_download_job.rb', line 13

def perform_tracked(course_user, assessment, students = nil)
  zip_file = Course::Assessment::Submission::ZipDownloadService.
             download_and_zip(course_user, assessment, students)
  redirect_to SendFile.send_file(zip_file, Pathname.normalize_filename(assessment.title) + '.zip')
end