Module: Course::Survey::ReorderingConcern

Extended by:
ActiveSupport::Concern
Included in:
SurveysController
Defined in:
app/controllers/concerns/course/survey/reordering_concern.rb

Instance Method Summary collapse

Instance Method Details

#reorder_questionsObject


14
15
16
17
18
19
20
21
# File 'app/controllers/concerns/course/survey/reordering_concern.rb', line 14

def reorder_questions
  if valid_question_ordering?(reorder_params)
    update_questions_ordering(reorder_params)
    render_survey_with_questions_json
  else
    head :bad_request
  end
end

#reorder_sectionsObject


5
6
7
8
9
10
11
12
# File 'app/controllers/concerns/course/survey/reordering_concern.rb', line 5

def reorder_sections
  if valid_section_ordering?(ordered_section_ids)
    update_sections_ordering(ordered_section_ids)
    render_survey_with_questions_json
  else
    head :bad_request
  end
end