扣分情况

dev_forum
daiao 6 years ago
parent c3ae52a7b6
commit a58bd2552a

@ -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

Loading…
Cancel
Save