TPI玩的时间

dev_home
daiao 5 years ago
parent 6098ecd3ca
commit e9a27be9df

@ -769,7 +769,7 @@ class GamesController < ApplicationController
def cost_time def cost_time
#return if @game.status >= 2 #return if @game.status >= 2
cost_time = (Time.now.to_i - @game.play_time.to_i) + @game.cost_time.to_i cost_time = (Time.now.to_i - @game.play_time.to_i) + @game.cost_time.to_i
@game.update_attributes(play_time: Time.now, cost_time: cost_time, play_sign: 0) @game.update_attributes(cost_time: cost_time, play_sign: 0)
end end
# 同步challenge的更新时间 # 同步challenge的更新时间

@ -3,7 +3,7 @@
# modify_time 与challenges表的modify_time联合使用2个字段一致则标识测试集未修改反之被修改 # modify_time 与challenges表的modify_time联合使用2个字段一致则标识测试集未修改反之被修改
# answer_open: 查看查看答案的深度, 0: 未查看过答案, 其他数值与challenge_answer的level值相关 # answer_open: 查看查看答案的深度, 0: 未查看过答案, 其他数值与challenge_answer的level值相关
# answer_deduction: 查看答案扣分的百分比;如 查看答案 扣除70% # answer_deduction: 查看答案扣分的百分比;如 查看答案 扣除70%
# #play_sign 与play_time: sign记录浏览器是否正常关闭 0表示正常1表示非正常 play_time表示游玩时间
class Game < ApplicationRecord class Game < ApplicationRecord
default_scope { order("games.created_at desc") } default_scope { order("games.created_at desc") }

Loading…
Cancel
Save