From 6fd68806d542b4a11b32b813ff940cfef9d2891c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 1 Dec 2014 16:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B=E6=95=99?= =?UTF-8?q?=E5=B8=88=E5=B0=B1=E5=85=B7=E6=9C=89=E5=BC=80=E5=90=AF=E3=80=81?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 3 +++ app/views/bids/_bid_homework_show.html.erb | 2 +- app/views/layouts/base_homework.html.erb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 816ee0bf8..28bac9627 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -570,6 +570,9 @@ class HomeworkAttachController < ApplicationController #获取课程的老师列表 def find_course_teachers course + t = [] + course.members.map{|m| t << m.user_id if m.user.allowed_to?(:as_teacher,course)} + teachers = "(" teacher_members = searchTeacherAndAssistant(course) teacher_members.each do |member| diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 630d7552c..e7b58fefc 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -68,7 +68,7 @@ <% end %> <% end %> - <% if (User.current.admin?||User.current.id==bid.author_id) %> + <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %> <% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%> <% case bid.comment_status %> diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 9ce2a6edf..7c40173a0 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -117,7 +117,7 @@
- <% if (User.current.admin?||User.current.id==@bid.author_id) %> + <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,course)) %>
<% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%>