|
|
|
@ -13,8 +13,8 @@ class GamesController < ApplicationController
|
|
|
|
|
def show
|
|
|
|
|
uid_logger("--games show start")
|
|
|
|
|
# 防止评测中途ajaxE被取消;3改成0是为了处理首次进入下一关的问题
|
|
|
|
|
@game.update_attribute(:status, 0) if @game.status == 1
|
|
|
|
|
@game.update_attributes(status: 0, open_time: Time.now) if @game.status == 3
|
|
|
|
|
update_game_parameter(@game)
|
|
|
|
|
|
|
|
|
|
game_challenge = Challenge.base_attrs.find(@game.challenge_id)
|
|
|
|
|
|
|
|
|
|
# 选择题类型的实训关卡总分
|
|
|
|
@ -964,4 +964,13 @@ class GamesController < ApplicationController
|
|
|
|
|
nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 更新关卡状态和一些学习进度
|
|
|
|
|
def update_game_parameter game
|
|
|
|
|
game.update_attribute(:status, 0) if game.status == 1
|
|
|
|
|
game.update_attributes(status: 0, open_time: Time.now) if game.status == 3
|
|
|
|
|
# 开启实训更新myshixuns的时间,方便跟踪用于的学习进度。
|
|
|
|
|
game.myshixun.update_column(:update_at, Time.now)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|