|
|
|
@ -667,6 +667,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
#立即发布的弹窗内容
|
|
|
|
|
def publish_modal
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
begin
|
|
|
|
|
exercise_ids = params[:check_ids]
|
|
|
|
@ -685,6 +686,9 @@ class ExercisesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
#首页批量或单独 立即发布,应是跳出弹窗,设置开始时间和截止时间。
|
|
|
|
|
def publish
|
|
|
|
|
tip_exception("缺少截止时间参数") if params[:end_time].blank?
|
|
|
|
|
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
|
|
|
|
|
tip_exception("截止时间不能晚于课堂结束时间") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
begin
|
|
|
|
|
check_ids = Exercise.where(id: params[:check_ids])
|
|
|
|
|