Class: Course::Assessment::Submission::AutoGradingService

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

Overview

Service to execute Course::Assessment::Submission::AutoGradingJob

Defined Under Namespace

Classes: SubJobError

Constant Summary collapse

MAX_TRIES =
5

Instance Method Summary collapse

Instance Method Details

#grade(submission) ⇒ Boolean

Grades into the given submission.

Parameters:

Returns:

  • (Boolean)

    True if the grading could be saved.


22
23
24
25
26
27
# File 'app/services/course/assessment/submission/auto_grading_service.rb', line 22

def grade(submission)
  grade_answers(submission)
  submission.reload
  assign_exp_and_publish_grade(submission) if submission.assessment.autograded?
  submission.save!
end