Class: Survey::Attempt

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.high_scoreObject



42
43
44
# File 'app/models/survey/attempt.rb', line 42

def self.high_score
  return scores.first.score
end

Instance Method Details

#correct_answersObject



34
35
36
# File 'app/models/survey/attempt.rb', line 34

def correct_answers
  return self.answers.where(:correct => true)
end

#incorrect_answersObject



38
39
40
# File 'app/models/survey/attempt.rb', line 38

def incorrect_answers
  return self.answers.where(:correct => false)
end