From 61aca8e4bf9574fd14d6516ef7d84fd3badf0c3a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 30 Jun 2017 22:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E9=87=91=E5=B8=81=E5=92=8C?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index b3e715157..a314445a7 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -82,7 +82,7 @@ class GamesController < ApplicationController @had_passed_testsests_error_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == false}.count @had_passed_testsests_hidden_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == false}.count @had_passed_testsests_public_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == true}.count - @final_score = (@game.answer_open? ? 0 : @game.final_score.to_i) + @final_score = ((@game.answer_open? || @shixun.status <= 1) ? 0 : @game.final_score.to_i) @had_done = ((@myshixun.games.where(:status => 2).count == @myshixun.games.count && @game_challenge.position == @myshixun.games.count) ? 1 : 0) error_position = had_test.blank? ? nil : had_test.select{|had_test| had_test.result == false}.last logger.info("latest output id is #{error_position.id unless error_position.blank?}") @@ -245,7 +245,7 @@ class GamesController < ApplicationController @had_passed_testsests_error_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == false}.count @had_passed_testsests_hidden_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == false}.count @had_passed_testsests_public_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == true}.count - @final_score = (@game.answer_open? ? 0 : @game.final_score.to_i) + @final_score = ((@game.answer_open? || shixun.status <= 1) ? 0 : @game.final_score.to_i) error_position = had_test.blank? ? nil : had_test.select{|had_test| had_test.result == false}.last @latest_output = error_position.try(:out_put).gsub(/\n/, '
').gsub(/\t/, '        ') unless error_position.try(:out_put).blank? render :json => {test_sets: total_test_sets,