diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 77d89c40c..31bfdb91e 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -247,7 +247,7 @@ class SubjectsController < ApplicationController def send_to_course @course = Course.find_by!(id: params[:course_id]) - stages = @subject.stages.where(id: @subject.stage_shixuns.where(shixun_id: params[:shixun_ids]).pluck(:stage_id)) + stages = @subject.stages.where(id: @subject.stage_shixuns.where(shixun_id: params[:shixun_ids]).pluck(:stage_id)).reorder("stages.position DESC") order_ids = params[:shixun_ids].size > 0 ? params[:shixun_ids].reverse.join(',') : -1 course_module = @course.course_modules.where(module_type: "shixun_homework").first homework_ids = []