diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 60b9a807c..5b7f3413f 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -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'