diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 4d256f3dc..afaa3a1b6 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -191,7 +191,7 @@ class SubjectsController < ApplicationController stages.each do |stage| category = CourseSecondCategory.where(name: stage.name, course_id: @course.id, category_type: "shixun_homework").first || CourseSecondCategory.create!(name: stage.name, course_id: @course.id, category_type: "shixun_homework", - course_module_id: course_module, position: course_module.course_second_categories.count + 1) + course_module_id: course_module.id, position: course_module.course_second_categories.count + 1) stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun| homework = HomeworksService.new.create_homework shixun, @course, category, current_user