diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index db929b94d..b0e356666 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -167,10 +167,10 @@ module ExercisesHelper effictive_users_ids = effictive_users.where("answer_text is not null and answer_text !=''").pluck(:user_id).uniq effictive_users_count = effictive_users_ids.size user_wrong_count = 0 - user_ids.each do |s| + effictive_users_ids.each do |s| user_score = effictive_users.where(user_id: s).pluck(:score).sum - unless user_score.to_f >= ex&.question_score.to_f - user_wrong_count + 1 + if user_score.to_f < ex&.question_score.to_f + user_wrong_count = user_wrong_count + 1 end end # user_wrong_ids = effictive_users.where()