Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
jingquan huang 5 years ago
commit e48b935043

@ -9,6 +9,8 @@ module GitHelper
# 版本库文件内容,带转码 # 版本库文件内容,带转码
def git_fle_content(repo_path, path) def git_fle_content(repo_path, path)
begin begin
logger.info("##########repo_path: #{repo_path}")
logger.info("##########path: #{path}")
content = GitService.file_content(repo_path: repo_path, path: path) content = GitService.file_content(repo_path: repo_path, path: path)
logger.info("@@@@@@@@@@@@@@@@@@#{content}") logger.info("@@@@@@@@@@@@@@@@@@#{content}")

@ -430,7 +430,10 @@ module ExercisesHelper
end end
ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id) ex_shixun_answer_content = answers_content&.where(exercise_shixun_challenge_id: exercise_cha.id)
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
logger.info("############_________exercise_cha.challenge&.path___________###############{exercise_cha.challenge&.path}")
cha_path = 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 game_challenge = game.game_codes.search_challenge_path(cha_path)&.first
if game_challenge.present? if game_challenge.present?
game_code = game_challenge game_code = game_challenge

@ -29,7 +29,7 @@ json.shixun_detail do
if game.try(:lastest_code).blank? if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path) 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 else
latest_code = game.try(:lastest_code) latest_code = game.try(:lastest_code)
end end

Loading…
Cancel
Save