From 895bb129f25ba156707c2206a526cc72ae12d9eb Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 21 Apr 2017 20:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=97=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index bd35b5a4d..93c590f7e 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -173,11 +173,12 @@ class GamesController < ApplicationController # 出错的测试用例序号 error_position = Output.where(:game_id => @game.id, :result => false).last static_error_position = error_position.blank? ? 0 : error_position.try(:test_set_position).to_i + consume_time = game_spend_time(@game.open_time, @game.updated_at) # 异常结果 latest_output = error_position.try(:out_put) render :json => {test_sets: total_test_sets, status: @game.status, had_done: had_done, latest_output: latest_output, error_position: static_error_position, had_passed_testsests:had_passed_testsests, test_sets_count:test_sets_count, test_sets_hidden_count:test_sets_hidden_count, - final_score:final_score, had_tested:had_tested} + final_score:final_score, had_tested:had_tested, consume_time: consume_time} end def change_status