题库问题

dev_local_2
daiao 5 years ago
parent 2f4c2b1d13
commit fc0a05bfae

@ -10,7 +10,7 @@ class QuestionBanksController < ApplicationController
def bank_list
page = params[:page] || 1
limit = params[:limit] || 15
@certification_teacher = current_user.is_certification_teacher || current_user.admin?
@certification_teacher = current_user.is_teacher || current_user.admin?
@objects = @object_type.classify.constantize.where(@object_filter)
@objects =
if params[:search]
@ -21,7 +21,7 @@ class QuestionBanksController < ApplicationController
#{@objects.table_name}.is_public = 1 and concat(#{@objects.table_name}.name, course_lists.name) like
'%#{params[:search]}%'
}
@objects.joins(:course_list).where(sql)
@objects.where(sql)
else
@objects.none
end
@ -30,7 +30,7 @@ class QuestionBanksController < ApplicationController
#{@objects.table_name}.user_id = #{current_user.id} and concat(#{@objects.table_name}.name, course_lists.name) like
'%#{params[:search]}%'
}
@objects.joins(:course_list).where(sql)
@objects.where(sql)
end
else
if params[:filter] == 'public'

Loading…
Cancel
Save