diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 5fe230d32..32175ec2f 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -270,7 +270,8 @@ class GamesController < ApplicationController if @game.status == 2 @game.update_attributes!(:answer_open => @answer.level) else - @game.update_attributes!(:answer_open => @answer.level, :answer_deduction => deduct_score) + answer_deduction = challenge.challenge_answers.where("level <= #{@answer.level}").sum(:score) + @game.update_attributes!(:answer_open => @answer.level, :answer_deduction => answer_deduction) end rescue Exception => e