From 752210f0fc025b978cd235bc7eaa9da13e1cbfe7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 17 Sep 2017 16:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=99=85=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 1 + public/javascripts/edu/edu_tpi.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 1fee13096..ca0c8943d 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -518,6 +518,7 @@ class GamesController < ApplicationController actual_output = (output.try(:actual_output) unless output.try(:actual_output).blank?) result = output.try(:result) compile_success = (actual_output.blank? || !actual_output.downcase.match(/error/).blank?) ? 0 : 1 + actual_output = match_specific_symbol(actual_output) if compile_success == 1 public_result = {:is_public => (test_set.is_public ? 1 : 0), :result => result, :input => test_set.input, :actual_output => actual_output, :output => test_set.output, :compile_success => compile_success} logger.info("1111#################################{public_result.to_json}") diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 6262874e0..d8fe6bd31 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -449,7 +449,7 @@ function code_evaluation(test_sets, "
  • " + "
    " + "实际输出:" + - "

    " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? match_specific_symbol(test_sets[i].actual_output) : test_sets[i].actual_output.replace(/\r\n/g, "
    "))) + "

    " + + "

    " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].actual_output)) + "

    " + "
    " + "
  • " + "" +