|
|
@ -13,7 +13,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
|
|
|
|
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
|
|
|
|
:left_banner, :top_banner]
|
|
|
|
:left_banner, :top_banner]
|
|
|
|
before_action :check_account, only: [:new, :apply_to_join_course]
|
|
|
|
before_action :check_account, only: [:new, :create, :apply_to_join_course]
|
|
|
|
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
|
|
|
|
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
|
|
|
|
:left_banner, :top_banner, :apply_to_join_course, :exit_course]
|
|
|
|
:left_banner, :top_banner, :apply_to_join_course, :exit_course]
|
|
|
|
before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt,
|
|
|
|
before_action :set_course, :user_course_identity, only: [:show, :update, :destroy, :settings, :set_invite_code_halt,
|
|
|
@ -927,12 +927,12 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师
|
|
|
|
role = course_message.content == 2 ? '7' : '9' # 7:助教 9:教师
|
|
|
|
ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role)
|
|
|
|
ApplyTeacherRoleJoinCourseNotifyJob.perform_later(current_user.id, course.id, role)
|
|
|
|
teacher_role = 1
|
|
|
|
|
|
|
|
message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
|
|
|
|
message = "#{course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
|
|
|
|
message = "#{existing_course_message.content == 2 ? '助教' : '教师'}申请已提交,请等待审核"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
teacher_role = 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if teacher_role && current_user.student_of_course?(course)
|
|
|
|
if teacher_role && current_user.student_of_course?(course)
|
|
|
|