|
|
|
@ -30,14 +30,14 @@ class CoursesController < ApplicationController
|
|
|
|
|
:informs, :update_informs, :online_learning, :update_task_position, :tasks_list,
|
|
|
|
|
:join_excellent_course, :export_couser_info, :export_member_act_score, :new_informs,
|
|
|
|
|
:delete_informs, :change_member_role, :course_groups, :join_course_group, :statistics,
|
|
|
|
|
:work_score, :act_score, :calculate_all_shixun_scores]
|
|
|
|
|
:work_score, :act_score, :calculate_all_shixun_scores, :move_to_category]
|
|
|
|
|
before_action :user_course_identity, except: [:join_excellent_course, :index, :create, :new, :apply_to_join_course,
|
|
|
|
|
:search_course_list, :get_historical_course_students, :mine, :search_slim, :board_list]
|
|
|
|
|
before_action :teacher_allowed, only: [:update, :destroy, :settings, :search_teacher_candidate,
|
|
|
|
|
:transfer_to_course_group, :delete_from_course, :export_member_scores_excel,
|
|
|
|
|
:search_users, :add_students_by_search, :get_historical_courses, :add_teacher_popup,
|
|
|
|
|
:add_teacher, :export_couser_info, :export_member_act_score,
|
|
|
|
|
:update_informs, :new_informs, :delete_informs, :switch_to_student]
|
|
|
|
|
:update_informs, :new_informs, :delete_informs, :switch_to_student, :move_to_category]
|
|
|
|
|
before_action :admin_allowed, only: [:set_invite_code_halt, :set_public_or_private, :change_course_admin,
|
|
|
|
|
:set_course_group, :create_group_by_importing_file,
|
|
|
|
|
:update_task_position, :tasks_list]
|
|
|
|
@ -118,6 +118,21 @@ class CoursesController < ApplicationController
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 视频移动到目录
|
|
|
|
|
def move_to_category
|
|
|
|
|
tip_exception("请选择要移动的目录") if params[:new_category_id].blank?
|
|
|
|
|
|
|
|
|
|
category = @course.course_second_categories.find_by(id: params[:new_category_id])
|
|
|
|
|
if params[:new_category_id].to_i == 0 || category.present?
|
|
|
|
|
videos = @course.course_videos.where(id: params[:video_ids])
|
|
|
|
|
|
|
|
|
|
videos.update_all(course_second_category_id: params[:new_category_id])
|
|
|
|
|
normal_status(0, "操作成功")
|
|
|
|
|
else
|
|
|
|
|
normal_status(-1, "目录不存在")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def visits_plus_one
|
|
|
|
|
new_visits = @course.visits + 1
|
|
|
|
|
@course.update_visits(new_visits)
|
|
|
|
@ -1259,7 +1274,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
@is_teacher = @user_course_identity < Course::ASSISTANT_PROFESSOR
|
|
|
|
|
@course_modules = @course.course_modules.where(hidden: 0)
|
|
|
|
|
@hidden_modules = @course.course_modules.where(hidden: 1)
|
|
|
|
|
@second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group"]
|
|
|
|
|
@second_category_type = ["shixun_homework", "graduation", "attachment", "board", "course_group", "video"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def board_list
|
|
|
|
|