Class: Course::Assessment::Answer::MultipleResponse

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/course/assessment/answer/multiple_response.rb

Instance Method Summary collapse

Instance Method Details

#assign_params(params) ⇒ Object


15
16
17
18
19
20
21
# File 'app/models/course/assessment/answer/multiple_response.rb', line 15

def assign_params(params)
  acting_as.assign_params(params)
  return unless params[:option_ids]

  option_ids = params[:option_ids].map(&:to_i)
  self.options = question.specific.options.select { |option| option_ids.include?(option.id) }
end

#reset_answerObject

Specific implementation of Course::Assessment::Answer#reset_answer


10
11
12
13
# File 'app/models/course/assessment/answer/multiple_response.rb', line 10

def reset_answer
  options.clear
  acting_as
end