diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8c8d121d1..b62840200 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -930,6 +930,7 @@ class HomeworkCommonsController < ApplicationController shixuns.each do |shixun| homework = HomeworksService.new.create_homework shixun, @course, @category, current_user @homework_ids << homework.id + CreateStudentWorkJob.perform_later(homework.id) end rescue Exception => e uid_logger(e.message) @@ -1031,6 +1032,7 @@ class HomeworkCommonsController < ApplicationController stage.shixuns.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun| homework = HomeworksService.new.create_homework shixun, @course, category, current_user @homework_ids << homework.id + CreateStudentWorkJob.perform_later(homework.id) end end end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index e910db8cc..b47a9a346 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -909,6 +909,7 @@ class ShixunsController < ApplicationController def send_to_course @course = Course.find(params[:course_id]) homework = HomeworksService.new.create_homework @shixun, @course, nil, current_user + CreateStudentWorkJob.perform_later(homework.id) end # 二维码扫描下载 diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index d97b7172c..7c76748b1 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -214,6 +214,7 @@ class SubjectsController < ApplicationController stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun| homework = HomeworksService.new.create_homework shixun, @course, category, current_user + CreateStudentWorkJob.perform_later(homework.id) end end rescue Exception => e diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index f6868afba..0dc814c89 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -15,7 +15,6 @@ class HomeworksService homework_detail_manual.save! if homework_detail_manual HomeworkCommonsShixun.create!(homework_common_id: homework.id, shixun_id: shixun.id) HomeworksService.new.create_shixun_homework_cha_setting(homework, shixun) - CreateStudentWorkJob.perform_later(homework.id) # HomeworksService.new.create_works_list(homework, course) end homework