作业选用题库和创建增加子目录

PCqiandao
cxt 5 years ago
parent 687c6a24fd
commit e80ae9f952

@ -376,6 +376,11 @@ class HomeworkCommonsController < ApplicationController
@homework.user_id = current_user.id @homework.user_id = current_user.id
@homework.course_id = @course.id @homework.course_id = @course.id
if params[:category].present?
category = @course.course_second_categories.find_by(id: params[:category])
@homework.course_second_category_id = category&.id.to_i
end
homework_detail_manual = HomeworkDetailManual.new homework_detail_manual = HomeworkDetailManual.new
@homework.homework_detail_manual = homework_detail_manual @homework.homework_detail_manual = homework_detail_manual
homework_detail_manual.te_proportion = 0.7 homework_detail_manual.te_proportion = 0.7

@ -212,6 +212,11 @@ class QuestionBanksController < ApplicationController
homework_type: homework.homework_type, course_id: course.id, homework_bank_id: homework.id, homework_type: homework.homework_type, course_id: course.id, homework_bank_id: homework.id,
reference_answer: homework.reference_answer) reference_answer: homework.reference_answer)
if params[:category].present?
category = course.course_second_categories.find_by(id: params[:category])
new_homework.course_second_category_id = category&.id.to_i
end
# 作业的基本设置复制 # 作业的基本设置复制
new_homework.homework_detail_manual = HomeworkDetailManual.new new_homework.homework_detail_manual = HomeworkDetailManual.new
new_homework_detail_manual = new_homework.homework_detail_manual new_homework_detail_manual = new_homework.homework_detail_manual

Loading…
Cancel
Save