diff --git a/app/controllers/poll_bank_questions_controller.rb b/app/controllers/poll_bank_questions_controller.rb index 19111f4ca..71f302115 100644 --- a/app/controllers/poll_bank_questions_controller.rb +++ b/app/controllers/poll_bank_questions_controller.rb @@ -127,7 +127,7 @@ class PollBankQuestionsController < ApplicationController end def poll_questions_params - params.require(:poll_question).permit(:question_title,:question_type,:is_necessary,:question_number,:max_choices,:min_choices) + params.permit(:question_title,:question_type,:is_necessary,:question_number,:max_choices,:min_choices) end def validates_params diff --git a/app/models/exercise_bank_question.rb b/app/models/exercise_bank_question.rb index 14b166333..fdd343f5a 100644 --- a/app/models/exercise_bank_question.rb +++ b/app/models/exercise_bank_question.rb @@ -1,6 +1,6 @@ class ExerciseBankQuestion < ApplicationRecord belongs_to :exercise_bank - belongs_to :shixun + belongs_to :shixun, optional: true has_many :exercise_bank_shixun_challenges,:dependent => :destroy has_many :exercise_bank_choices, :dependent => :destroy has_many :exercise_bank_standard_answers, :dependent => :destroy