Class: AskIt::Attempt

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.high_scoreObject



63
64
65
# File 'app/models/ask_it/attempt.rb', line 63

def self.high_score
  scores.first.score
end

Instance Method Details

#collect_scores!Object



58
59
60
61
# File 'app/models/ask_it/attempt.rb', line 58

def collect_scores!
  collect_scores
  save
end

#correct_answersObject



50
51
52
# File 'app/models/ask_it/attempt.rb', line 50

def correct_answers
  answers.where(correct: true)
end

#incorrect_answersObject



54
55
56
# File 'app/models/ask_it/attempt.rb', line 54

def incorrect_answers
  answers.where(correct: false)
end