|
|
|
@ -53,7 +53,7 @@ namespace :migrate_course_resource do
|
|
|
|
|
if homework.course_second_category.present?
|
|
|
|
|
target_category = CourseSecondCategory.find_by(name: homework.course_second_category.name, course_id: target_course.id, category_type: "shixun_homework")
|
|
|
|
|
unless target_category.present?
|
|
|
|
|
course_module = Course.course_modules.find_by(module_type: "shixun_homework")
|
|
|
|
|
course_module = target_course.course_modules.find_by(module_type: "shixun_homework")
|
|
|
|
|
target_category = CourseSecondCategory.create(name: homework.course_second_category.name, course_id: target_course.id,
|
|
|
|
|
category_type: "shixun_homework", course_module_id: course_module&.id,
|
|
|
|
|
position: course_module&.course_second_categories&.count.to_i + 1)
|
|
|
|
@ -217,7 +217,7 @@ namespace :migrate_course_resource do
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# CourseAddStudentCreateWorksJob.perform_later(target_course.id, new_user_ids) unless new_user_ids.blank?
|
|
|
|
|
CourseAddStudentCreateWorksJob.perform_later(target_course.id, new_user_ids) unless new_user_ids.blank?
|
|
|
|
|
|
|
|
|
|
group.teacher_course_groups.each do |teacher_group|
|
|
|
|
|
member = CourseMember.find_by(course_id: target_course.id, user_id: teacher_group.user_id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR])
|
|
|
|
|