From 8cfb86d76c9857493bc5f926408fe80ad49cd91d Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 29 Jun 2019 10:28:30 +0800 Subject: [PATCH 1/3] fix bug --- app/views/exercises/_shixun_details.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index 96e5c6281..85bf532e1 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -29,7 +29,7 @@ json.shixun_detail do if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) - latest_code = git_fle_content(game&.myshixun.repo_path,cha_path) + latest_code = git_fle_content(game.myshixun.repo_path,cha_path) else latest_code = game.try(:lastest_code) end From 067c516561d1fc70ae7152cf2893d0d16673fec8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 29 Jun 2019 10:43:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/concerns/git_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/concerns/git_helper.rb b/app/controllers/concerns/git_helper.rb index 8e7288df2..78eae769c 100644 --- a/app/controllers/concerns/git_helper.rb +++ b/app/controllers/concerns/git_helper.rb @@ -9,6 +9,8 @@ module GitHelper # 版本库文件内容,带转码 def git_fle_content(repo_path, path) begin + logger.info("##########repo_path: #{repo_path}") + logger.info("##########path: #{path}") content = GitService.file_content(repo_path: repo_path, path: path) logger.info("@@@@@@@@@@@@@@@@@@#{content}") From 76d16698a1d83e3ac5753d6f8c3c56b3fd0bb72c Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 29 Jun 2019 10:49:05 +0800 Subject: [PATCH 3/3] fix bug --- app/helpers/exercises_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 5f8683fd0..6ec6cd601 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -430,7 +430,10 @@ module ExercisesHelper end ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id) if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 + logger.info("############_________exercise_cha.challenge&.path___________###############{exercise_cha.challenge&.path}") cha_path = challenge_path(exercise_cha.challenge&.path) + logger.info("############_________cha_path___________###############{cha_path}") + game_challenge = game.game_codes.search_challenge_path(cha_path)&.first if game_challenge.present? game_code = game_challenge