We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6895ad commit d5b4871Copy full SHA for d5b4871
example_app/app/models/completion.rb
@@ -15,8 +15,7 @@ def answers_attributes=(answers_attributes)
15
16
def score
17
answers.inject(0) do |result, answer|
18
- question = answer.question
19
- result + question.score(answer.text)
+ result + score_for_answer(answer)
20
end
21
22
@@ -25,4 +24,9 @@ def score
25
24
def completion_notification
26
Mailer.completion_notification(user).deliver
27
+
28
+ def score_for_answer(answer)
29
+ question = answer.question
30
+ question.score(answer.text)
31
+ end
32
0 commit comments