From 1250c6e664ee1fc4bfdc9fae064deb8c311fec98 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 4 Sep 2019 17:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BD=9C=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 ++ app/controllers/shixuns_controller.rb | 1 + app/controllers/subjects_controller.rb | 1 + app/services/homeworks_service.rb | 1 - 4 files changed, 4 insertions(+), 1 deletion(-) 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