修改课程教师就具有开启、关闭匿评、修改作业的权限

This commit is contained in:
sw 2014-12-01 16:45:03 +08:00
parent 21c4caa7a6
commit 6fd68806d5
3 changed files with 5 additions and 2 deletions

View File

@ -570,6 +570,9 @@ class HomeworkAttachController < ApplicationController
#获取课程的老师列表 #获取课程的老师列表
def find_course_teachers course def find_course_teachers course
t = []
course.members.map{|m| t << m.user_id if m.user.allowed_to?(:as_teacher,course)}
teachers = "(" teachers = "("
teacher_members = searchTeacherAndAssistant(course) teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member| teacher_members.each do |member|

View File

@ -68,7 +68,7 @@
</span> </span>
<% end %> <% end %>
<% 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%> <% if bid.open_anonymous_evaluation == 1 && bid.homeworks.count >= 2%>
<span id="<%=bid.id %>_anonymous_comment" class="span_wping"> <span id="<%=bid.id %>_anonymous_comment" class="span_wping">
<% case bid.comment_status %> <% case bid.comment_status %>

View File

@ -117,7 +117,7 @@
<div class="inf_user_image"> <div class="inf_user_image">
<table> <table>
<% if (User.current.admin?||User.current.id==@bid.author_id) %> <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,course)) %>
<tr> <tr>
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2"> <td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
<% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%> <% if @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2%>