From d3602d9251ec9598fdfd27e293d8264e0e152884 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 26 May 2017 09:48:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=AF=84=E6=B5=8B=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E5=85=B3=E9=80=9A=E8=BF=87=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E6=98=BE=E7=A4=BA=E9=80=9A=E8=BF=87=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 70c2dfd11..c4d780c0e 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -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