|
|
|
@ -29,6 +29,11 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 提交结果显示
|
|
|
|
|
def result
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 接收中间件返回结果接口
|
|
|
|
|
# 调试模式: status: 0 表示评测无错误,其他 表示错误(如编译出错,执行出错,超时等)
|
|
|
|
|
def listen_result
|
|
|
|
@ -132,11 +137,18 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 老师、自己、管理可以评测他人的编程题
|
|
|
|
|
# 老师、自己、管理可以查看他人的编程题
|
|
|
|
|
def require_manager_identity
|
|
|
|
|
unless current_user.certification_teacher? || admin_or_business? || @my_hack.user_id == current_user.id
|
|
|
|
|
tip_exception(403, "..")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 只有自己才能评测
|
|
|
|
|
def require_auth_identity
|
|
|
|
|
unless @my_hack.user_id == current_user.id
|
|
|
|
|
tip_exception(403, "..")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|