开启实训有问题

dev_course
daiao 5 years ago
parent 82c0318861
commit 977a966706

@ -454,7 +454,7 @@ class GamesController < ApplicationController
begin begin
@content = git_fle_content(@myshixun.repo_path, path) || "" @content = git_fle_content(@myshixun.repo_path, path) || ""
rescue rescue
if params[:retry].present? if params[:retry].to_i == 1
begin begin
begin begin
# 检测TPM对应的路径代码是否正常 # 检测TPM对应的路径代码是否正常

@ -77,14 +77,17 @@ class Challenge < ApplicationRecord
def user_tpi_status user_id def user_tpi_status user_id
# todo: 以前没加索引导致相同关卡,同一用户有多个games # todo: 以前没加索引导致相同关卡,同一用户有多个games
# 允许跳关则直接开启 # 允许跳关则直接开启
return 1 if shixun.task_pass
game = games.where(user_id: user_id).take game = games.where(user_id: user_id).take
if game.blank? if game.blank?
self.position == 1 ? 1 : 0 self.position == 1 ? 1 : 0
elsif game.status == 2 elsif game.status == 2
2 2
else else
1 if shixun.task_pass
1
else
0
end
end end
end end

Loading…
Cancel
Save