Class: Course::Assessment::Answer::AutoGradingJob

Inherits:
ApplicationJob
  • Object
show all
Includes:
TrackableJob
Defined in:
app/jobs/course/assessment/answer/auto_grading_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(answer, redirect_to_path = nil) ⇒ Object (protected)

Performs the auto grading.

Parameters:

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

    The path to be redirected after auto grading job was finished.

  • answer (Course::Assessment::Answer)

    the answer to be graded.

  • redirect_to_path (String) (defaults to: nil)

    The path to redirect when job finishes.


21
22
23
24
25
26
27
# File 'app/jobs/course/assessment/answer/auto_grading_job.rb', line 21

def perform_tracked(answer, redirect_to_path = nil)
  ActsAsTenant.without_tenant do
    Course::Assessment::Answer::AutoGradingService.grade(answer)
  end

  redirect_to redirect_to_path
end