From b69013c055d1b0021d2854b8bf26cc1e34a52cef Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 12 Oct 2019 15:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/question_banks_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 7781b5792..066771570 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -95,20 +95,26 @@ class QuestionBanksController < ApplicationController case @object_type when 'HomeworkBank' # 作业 task = quote_homework_bank bank, course + category_id = course.course_modules.find_by(module_type: task.homework_type == "normal" ? "common_homework" : "group_homework")&.id when 'ExerciseBank' if bank.container_type == 'Exercise' # 试卷 task = quote_exercise_bank bank, course + category_id = course.course_modules.find_by(module_type: "exercise")&.id else # 问卷 task = quote_poll_bank bank, course + category_id = course.course_modules.find_by(module_type: "poll")&.id end when 'GtaskBank' task = quote_gtask_bank bank, course + category_id = course.course_modules.find_by(module_type: "graduation")&.id when 'GtopicBank' task = quote_gtopic_bank bank, course + category_id = course.course_modules.find_by(module_type: "graduation")&.id end task_ids << task.id if task end - render :json => {task_ids: task_ids, status: 0, message: "发送成功"} + + render :json => {task_ids: task_ids, category_id: category_id, status: 0, message: "发送成功"} end def destroy