|
|
|
@ -787,7 +787,8 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
def create_shixun_homework
|
|
|
|
|
tip_exception("请至少选择一个实训") if params[:shixun_ids].blank?
|
|
|
|
|
shixuns = Shixun.where(id: params[:shixun_ids]).order("field(id, #{params[:shixun_ids].reverse})")
|
|
|
|
|
order_ids = params[:shixun_ids].size > 0 ? params[:shixun_ids].reverse.join(',') : -1
|
|
|
|
|
shixuns = Shixun.where(id: params[:shixun_ids]).order("field(id, #{order_ids})")
|
|
|
|
|
@homework_ids = []
|
|
|
|
|
unless params[:category_id].blank?
|
|
|
|
|
@category = @course.course_second_categories.find_by(id: params[:category_id], category_type: "shixun_homework")
|
|
|
|
|