|
|
|
@ -13,6 +13,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
include ApplicationHelper
|
|
|
|
|
helper SyllabusesHelper
|
|
|
|
|
|
|
|
|
|
before_filter :local_exam, :except => [:show, :index]
|
|
|
|
|
# before_filter :auth_login1, :only => [:show, :course_activity, :feedback]
|
|
|
|
|
if Redmine::Configuration['gitlab_address'].include?("test")
|
|
|
|
|
skip_before_filter :verify_authenticity_token, :only => [:update_course_module, :join_course_multi_role]
|
|
|
|
@ -1617,6 +1618,8 @@ class CoursesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def show
|
|
|
|
|
if LocalSetting.first.try(:exam) && !User.current.admin?
|
|
|
|
|
else
|
|
|
|
|
# 被删除的课程只有超级管理员才能看到,is_delete为1的时候,标记课程被删除
|
|
|
|
|
# if @course.is_delete == 1 && !User.current.admin?
|
|
|
|
|
# render_403
|
|
|
|
@ -1635,7 +1638,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
@course_modules = @course.course_modules.where(:hidden => 0)
|
|
|
|
|
course_module_type = @course_modules.map(&:module_type)
|
|
|
|
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
|
|
|
|
@is_teacher = User.current.allowed_to?(:as_teacher, @course) || User.current.admin?
|
|
|
|
|
if User.current.member_of_course?(@course) && !@is_teacher
|
|
|
|
|
member = @course.members.where(:user_id => User.current.id).first
|
|
|
|
|
if member.try(:course_group_id).to_i == 0
|
|
|
|
@ -1745,6 +1748,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
@left_nav_type = 1
|
|
|
|
|
@show_page = true
|
|
|
|
|
end
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
format.html{render :layout => 'base_courses'}
|
|
|
|
|