重新评测最后一关通过的时候显示通过所有关

This commit is contained in:
huang 2017-05-26 09:48:06 +08:00
parent 78a67570c7
commit d3602d9251
1 changed files with 5 additions and 1 deletions

View File

@ -200,7 +200,11 @@ class GamesController < ApplicationController
else # 重新评测
if params[:resubmit] == resubmit_identifier # 本次重新评测结果已经返回并存入数据库
game_status = (@game.retry_status == 2 ? 2 : 0) # retry_status 2成功 1 失败
had_done = 0
if game_status == 2 && had_done == 1 # 重新评测如果评测成功
had_done =1
else
had_done = 0
end
else
# game_status 在前端有行为判断2表示通关0表示失败1表示评测中的中间状态
game_status = 1