试卷当版本库异常时的处理

dev_hs
SylorHuang 6 years ago
commit d2b691228e

@ -34,8 +34,7 @@ module GitHelper
rescue Exception => e rescue Exception => e
Rails.logger.error(e.message) Rails.logger.error(e.message)
Rails.logger.error("#####__________文档内容获取异常") raise Educoder::TipException.new("文档内容获取异常")
# raise Educoder::TipException.new("文档内容获取异常")
end end
end end

@ -484,7 +484,11 @@ module ExercisesHelper
game_code = game_challenge game_code = game_challenge
code = game_code.try(:new_code) code = game_code.try(:new_code)
else else
begin
code = git_fle_content(game.myshixun.repo_path,cha_path) code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
end end
end end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -31,8 +31,9 @@ json.shixun_detail do
if shixun_challenge.challenge&.path.present? if shixun_challenge.challenge&.path.present?
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)
begin
latest_code = git_fle_content(game.myshixun.repo_path,cha_path) latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
if latest_code.to_s == "true" rescue
latest_code = "" latest_code = ""
end end
else else

@ -149,7 +149,12 @@ namespace :excellent_course_exercise do
game_code = game_challenge game_code = game_challenge
code = game_code.try(:new_code) code = game_code.try(:new_code)
else else
begin #8-23,hs
code = git_fle_content(game.myshixun.repo_path,cha_path) code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
# code = git_fle_content(game.myshixun.repo_path,cha_path)
end end
end end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里 if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

Loading…
Cancel
Save