From a8b0f950c71eacef61154a822821c96978db7194 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 29 Jun 2019 09:52:17 +0800 Subject: [PATCH] fix bug --- app/views/exercises/_shixun_details.json.jbuilder | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index de847ebed..ac3884336 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -27,15 +27,11 @@ json.shixun_detail do json.output_detail output_detail game, output end - if game.evaluate_count > 0 - if game.try(:lastest_code).blank? - cha_path = challenge_path(shixun_challenge.challenge&.path) - latest_code = git_fle_content(shixun_challenge.shixun&.repo_path,cha_path) - else - latest_code = game.try(:lastest_code) - end + if game.try(:lastest_code).blank? + cha_path = challenge_path(shixun_challenge.challenge&.path) + latest_code = git_fle_content(shixun_challenge.shixun&.repo_path,cha_path) else - latest_code = nil + latest_code = game.try(:lastest_code) end json.passed_code latest_code