diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 1dd1d73a2..77d89c40c 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -259,7 +259,7 @@ class SubjectsController < ApplicationController CourseSecondCategory.create!(name: stage.name, course_id: @course.id, category_type: "shixun_homework", course_module_id: course_module.id, position: course_module.course_second_categories.count + 1) - shixuns = stage.shixuns.no_jupyter.published.where(id: params[:shixun_ids]).order("field(shixuns.id, #{order_ids})") + shixuns = stage.shixuns.no_jupyter.published.where(id: params[:shixun_ids]).reorder("field(shixuns.id, #{order_ids})") shixuns.each do |shixun| homework = HomeworksService.new.create_homework shixun, @course, category, current_user homework_ids << homework.id