Class: Course::Assessment::Question::AnswersEvaluationService

Inherits:
Object
  • Object
show all
Defined in:
app/services/course/assessment/question/answers_evaluation_service.rb

Overview

Evaluates all answers associated with the given question. Call this service after the package of the question is updated.

Instance Method Summary collapse

Constructor Details

#initialize(question) ⇒ AnswersEvaluationService

Returns a new instance of AnswersEvaluationService

Parameters:


7
8
9
# File 'app/services/course/assessment/question/answers_evaluation_service.rb', line 7

def initialize(question)
  @question = question
end

Instance Method Details

#callObject


11
12
13
14
15
# File 'app/services/course/assessment/question/answers_evaluation_service.rb', line 11

def call
  @question.answers.without_attempting_state.find_each do |a|
    a.auto_grade!(reduce_priority: true)
  end
end