diff --git a/app/models/proxy_exercise.rb b/app/models/proxy_exercise.rb index 699d91f5..2e2216ed 100644 --- a/app/models/proxy_exercise.rb +++ b/app/models/proxy_exercise.rb @@ -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 / ((Math::E**(-3 / (total_count_tag * 0.5) * (count_tag - (total_count_tag * 0.5)))) + 1) end def select_easiest_exercise(exercises) diff --git a/lib/py_lint_adapter.rb b/lib/py_lint_adapter.rb index 42f82b2e..1c742c56 100644 --- a/lib/py_lint_adapter.rb +++ b/lib/py_lint_adapter.rb @@ -16,7 +16,7 @@ class PyLintAdapter < TestingFrameworkAdapter else captures = regex_match.map(&:to_f) count = captures.second - passed = captures.first >= 0 ? captures.first : 0 + passed = [captures.first, 0].max failed = count - passed end