Class: Survey::Answer

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/survey/answer.rb

Instance Method Summary collapse

Instance Method Details

#correct?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/models/survey/answer.rb', line 30

def correct?
  self.correct or self.option.correct?
end

#valueObject



22
23
24
25
26
27
28
# File 'app/models/survey/answer.rb', line 22

def value
  unless self.option == nil
    self.option.weight
  else
    Survey::Option.find(option_id).weight
  end
end