Fix return value of logger being assigned to exercise
This commit is contained in:
@ -37,8 +37,8 @@ class ProxyExercise < ActiveRecord::Base
|
|||||||
assigned_user_proxy_exercise.exercise
|
assigned_user_proxy_exercise.exercise
|
||||||
else
|
else
|
||||||
matching_exercise =
|
matching_exercise =
|
||||||
Rails.logger.debug("find new matching exercise for user #{user.id}" )
|
|
||||||
begin
|
begin
|
||||||
|
Rails.logger.debug("find new matching exercise for user #{user.id}" )
|
||||||
find_matching_exercise(user)
|
find_matching_exercise(user)
|
||||||
rescue => e #fallback
|
rescue => e #fallback
|
||||||
Rails.logger.error("finding matching exercise failed. Fall back to random exercise! Error: #{$!}" )
|
Rails.logger.error("finding matching exercise failed. Fall back to random exercise! Error: #{$!}" )
|
||||||
@ -85,8 +85,7 @@ class ProxyExercise < ActiveRecord::Base
|
|||||||
@reason[:reason] = "easiest exercise in pool. empty potential exercises"
|
@reason[:reason] = "easiest exercise in pool. empty potential exercises"
|
||||||
select_easiest_exercise(exercises)
|
select_easiest_exercise(exercises)
|
||||||
else
|
else
|
||||||
recommended_exercise = select_best_matching_exercise(user, exercises_user_has_accessed, potential_recommended_exercises)
|
select_best_matching_exercise(user, exercises_user_has_accessed, potential_recommended_exercises)
|
||||||
recommended_exercise
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -238,4 +237,4 @@ class ProxyExercise < ActiveRecord::Base
|
|||||||
exercises.order(:expected_difficulty).first
|
exercises.order(:expected_difficulty).first
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user