Fix rubocop offenses
This commit is contained in:
@@ -68,7 +68,9 @@ class Exercise < ApplicationRecord
|
||||
if submissions.exists?(cause: 'submit')
|
||||
maximum_scores_query = submissions.select('MAX(score) AS maximum_score').group(:user_id).to_sql.sub('$1', id.to_s)
|
||||
self.class.connection.execute("SELECT AVG(maximum_score) AS average_score FROM (#{maximum_scores_query}) AS maximum_scores").first['average_score'].to_f
|
||||
else 0 end
|
||||
else
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
def average_number_of_submissions
|
||||
|
@@ -240,7 +240,7 @@ class ProxyExercise < ApplicationRecord
|
||||
|
||||
def tag_diminishing_return_function(count_tag, total_count_tag)
|
||||
total_count_tag += 1 # bonus exercise comes on top
|
||||
1 / (1 + (Math::E**(-3 / (0.5 * total_count_tag) * (count_tag - 0.5 * total_count_tag))))
|
||||
1 / (1 + (Math::E**(-3 / (0.5 * total_count_tag) * (count_tag - (0.5 * total_count_tag)))))
|
||||
end
|
||||
|
||||
def select_easiest_exercise(exercises)
|
||||
|
Reference in New Issue
Block a user