教师用户查看课程学生列表时显示真实姓名

This commit is contained in:
sw 2014-09-29 16:49:47 +08:00
parent 4d21b853bf
commit ca519ce22d
2 changed files with 3 additions and 6 deletions

View File

@ -641,7 +641,7 @@ class CoursesController < ApplicationController
def isCourseTeacher(id,course)
result = false
user = User.find(id)
if user.nil? && user.allowed_to?(:as_teacher,course)#@teachers && @teachers.count != 0 && @teachers.find_by_user_id(id) != nil
if !user.nil? && user.allowed_to?(:as_teacher,course)
result = true
end
result

View File

@ -13,11 +13,8 @@
<% end %>
<!--teacher's code disapeared moified by huang-->
<% unless member.user.user_extensions.identity ==0 %>
<!-- added by bai 加学号 -->
<%if @canShowCode%>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %>
<% end %>
<%if @canShowCode%>
<%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %>
<% end %>
<div class ="clear avatar_name"> &nbsp;
<p>