From e16705846747e8ac1e4711fa321c8a6c71624cd0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 18 Nov 2019 15:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hack_user_lastest_codes_controller.rb | 14 +++++++++++++- config/routes.rb | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 752a79cb3..41af54204 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -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 diff --git a/config/routes.rb b/config/routes.rb index 66bb382e8..d5fc2021c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,6 +44,7 @@ Rails.application.routes.draw do get :start get :code_debug get :code_submit + get :result match :listen_result, :via => [:get, :post] end end