Class: Course::Assessment::Question::VoiceResponse

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

Instance Method Summary collapse

Instance Method Details

#attempt(submission, last_attempt = nil) ⇒ Object


5
6
7
8
9
10
11
# File 'app/models/course/assessment/question/voice_response.rb', line 5

def attempt(submission, last_attempt = nil)
  answer =
    Course::Assessment::Answer::VoiceResponse.new(submission: submission, question: question)
  answer.attachment_reference = last_attempt.attachment_reference.dup if last_attempt&.attachment_reference

  answer.acting_as
end

#initialize_duplicate(duplicator, other) ⇒ Object


13
14
15
16
# File 'app/models/course/assessment/question/voice_response.rb', line 13

def initialize_duplicate(duplicator, other)
  copy_attributes(other)
  associate_duplicated_skills(duplicator, other)
end

#question_typeObject

returns the type of question i.e. Audio response


19
20
21
# File 'app/models/course/assessment/question/voice_response.rb', line 19

def question_type
  I18n.t('course.assessment.question.voice_responses.question_type')
end