Some comments and cleanup of exercise.rb percentage calculation
This commit is contained in:
@ -29,7 +29,11 @@ class Exercise < ActiveRecord::Base
|
||||
|
||||
|
||||
def average_percentage
|
||||
(average_score / maximum_score * 100).round if average_score and maximum_score != 0.0 else 0
|
||||
if average_score and maximum_score != 0.0
|
||||
(average_score / maximum_score * 100).round
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
def average_score
|
||||
|
Reference in New Issue
Block a user