competitions
cxt 6 years ago
parent c41e066f83
commit b69013c055

@ -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

Loading…
Cancel
Save