diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index e7ab001da..d9458bdaa 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -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 diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 7cd4da414..9ff31a9d2 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -27,7 +27,7 @@