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

dev_course
cxt 5 years ago
commit 6cbbb2dc32

@ -522,7 +522,13 @@ class ShixunsController < ApplicationController
end
# 如果存在实训,则直接进入实训
@current_task = current_myshixun.current_task(games)
# 如果实训允许跳关传参params[:challenge_id]跳入具体的关卡
@current_task =
if params[:challenge_id] && @shixun.task_pass
games.where(challenge_id: params[:challenge_id]).take
else
current_myshixun.current_task(games)
end
else
# 如果未创建关卡一定不能开启实训否则TPI没法找到当前的关卡
if @shixun.challenges_count == 0

@ -17,7 +17,7 @@ if @challenges.present?
json.passed_count challenge.user_passed_count
json.playing_count challenge.playing_count
json.name_url shixun_challenge_path(challenge, shixun_identifier: @shixun.identifier)
json.open_game challenge.open_game(@user.id, @shixun)
#json.open_game challenge.open_game(@user.id, @shixun)
if @editable
json.edit_url edit_shixun_challenge_path(challenge, shixun_identifier: @shixun.identifier)
json.delete_url shixun_challenge_path(challenge, shixun_identifier: @shixun.identifier)

Loading…
Cancel
Save