dev_forge
daiao 5 years ago
parent 99a21ac341
commit 9e51bc7641

@ -15,10 +15,9 @@ class HackUserLastestCodesController < ApplicationController
render_ok
end
# 复初始代码
# 复初始代码
def restore_initial_code
@my_hack.update_attribute(:code, @hack.code)
render_ok
end
# 调试代码
@ -55,7 +54,9 @@ class HackUserLastestCodesController < ApplicationController
end
# 提交记录
def submit_records;end
def submit_records
@records = @my_hack.hack_user_codes.created_order
end
# 提交记录详情

@ -199,7 +199,7 @@ class HacksController < ApplicationController
end
def start_hack_auth
return true if @hack == 1
return true if @hack.status == 1
require_auth_identity
end

@ -1,4 +1,6 @@
class HackUserCode < ApplicationRecord
# 用户编程题的信息
belongs_to :hack
scope :created_order, ->{ order("created_at desc")}
end

@ -1,4 +1,4 @@
json.array! @my_hack.hack_user_codes do |hack_user|
json.array! @records do |hack_user|
json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory)
json.language hack_user.hack.language
end
Loading…
Cancel
Save