|
|
@ -270,6 +270,7 @@ class GamesController < ApplicationController
|
|
|
|
if @game.status == 2
|
|
|
|
if @game.status == 2
|
|
|
|
@game.update_attributes!(:answer_open => @answer.level)
|
|
|
|
@game.update_attributes!(:answer_open => @answer.level)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
# 扣除总分计算
|
|
|
|
answer_deduction = challenge.challenge_answers.where("level <= #{@answer.level}").sum(:score)
|
|
|
|
answer_deduction = challenge.challenge_answers.where("level <= #{@answer.level}").sum(:score)
|
|
|
|
@game.update_attributes!(:answer_open => @answer.level, :answer_deduction => answer_deduction)
|
|
|
|
@game.update_attributes!(:answer_open => @answer.level, :answer_deduction => answer_deduction)
|
|
|
|
end
|
|
|
|
end
|
|
|
|