Class: Course::Assessment::Submission::ZipDownloadService

Inherits:
Object
  • Object
show all
Defined in:
app/services/course/assessment/submission/zip_download_service.rb

Constant Summary collapse

STUDENTS =
{ my: 'my', phantom: 'phantom' }.freeze

Class Method Summary collapse

Class Method Details

.download_and_zip(course_user, assessment, students) ⇒ String

Downloads the submissions and zip them.

Accepted values: 'my_students', 'students', 'others'

Parameters:

  • course_user (CourseUser)

    The course user downloading the submissions.

  • assessment (Course::Assessment)

    The assessments to download submissions from.

  • students (String|nil)

    The subset of students whose submissions to download.

Returns:

  • (String)

    The path to the zip file.


11
12
13
14
15
16
17
# File 'app/services/course/assessment/submission/zip_download_service.rb', line 11

def download_and_zip(course_user, assessment, students)
  service = new(course_user, assessment, students)
  ActsAsTenant.without_tenant do
    service.send(:download_to_base_dir)
  end
  service.send(:zip_base_dir)
end