|
|
|
@ -6,7 +6,7 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
before_action :require_manager_identity, only: [:update_code]
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
@my_hack.update_attribute(:status, 0) if @my_hack.status == 1
|
|
|
|
|
@my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update_code
|
|
|
|
@ -33,8 +33,11 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
# 提交结果显示
|
|
|
|
|
def result
|
|
|
|
|
return if @my_hack.status == 1
|
|
|
|
|
|
|
|
|
|
if @my_hack.submit_status == 1
|
|
|
|
|
render json: {status:0, message: "正在评测中"}
|
|
|
|
|
else
|
|
|
|
|
@my_hack.hack_user_lastest_code
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 接收中间件返回结果接口
|
|
|
|
|