|
|
|
@ -541,7 +541,7 @@ module UsersHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#获取指定用户作为老师的课程
|
|
|
|
|
=begin
|
|
|
|
|
def get_as_teacher_courses user
|
|
|
|
|
type = []
|
|
|
|
|
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
|
|
|
@ -552,5 +552,18 @@ module UsersHelper
|
|
|
|
|
end
|
|
|
|
|
type
|
|
|
|
|
end
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
|
|
#获取指定用户作为老师的课程
|
|
|
|
|
def get_as_teacher_courses_terms user
|
|
|
|
|
type = []
|
|
|
|
|
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
|
|
|
|
option = []
|
|
|
|
|
option << course.name+"("+course.time.to_s+course.term+")"
|
|
|
|
|
option << course.id
|
|
|
|
|
type << option
|
|
|
|
|
end
|
|
|
|
|
type
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|