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}") 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 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