|
|
|
@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController
|
|
|
|
|
# 更新相应对象的子目录id
|
|
|
|
|
if @course_module.module_type == "shixun_homework"
|
|
|
|
|
@category.homework_commons.update_all(course_second_category_id: 0)
|
|
|
|
|
@right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}"
|
|
|
|
|
@right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}"
|
|
|
|
|
elsif @course_module.module_type == "attachment"
|
|
|
|
|
Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
|
|
|
|
|
@right_url = "/courses/#{@course.id}/files/#{@course_module.id}"
|
|
|
|
|
@right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}"
|
|
|
|
|
elsif @course_module.module_type == "video"
|
|
|
|
|
@course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
|
|
|
|
|
@right_url = "/classrooms/#{@course.id}/course_videos"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@category.destroy
|
|
|
|
|