课堂任务的时间调整

dev_jupyter
cxt 5 years ago
parent 91a83784e0
commit a4964802a3

@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
if !Rails.env.development? && EduSetting.get("host_name") != "https://test-newweb.educoder.net"
if !Rails.env.development?
Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释

@ -402,7 +402,7 @@ class ExercisesController < ApplicationController
if unified_setting || (course_group_ids.size == 0)
tip_exception("发布时间不能为空") if params[:publish_time].blank?
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于发布时间") if params[:publish_time].to_time > params[:end_time].to_time
tip_exception("截止时间必须晚于发布时间") if params[:publish_time].to_time >= params[:end_time].to_time
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @course.end_date.present? && params[:end_time].to_time > @course.end_date.end_of_day
params_publish_time = params[:publish_time].to_time

@ -384,11 +384,11 @@ class GraduationTasksController < ApplicationController
if @task.status == 0
tip_exception("发布时间不能为空") if params[:publish_time].blank?
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("发布时间不能早于当前时间") if params[:publish_time].to_time <= Time.now
tip_exception("截止时间不能早于当前时间") if params[:end_time].to_time <= Time.now
tip_exception("截止时间必须晚于发布时间") if params[:publish_time].to_time >= params[:end_time].to_time
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@course.end_date.present? && params[:end_time].to_time > @course.end_date.end_of_day
@task.publish_time = params[:publish_time]
@task.end_time = params[:end_time]

@ -724,7 +724,7 @@ class PollsController < ApplicationController
if unified_setting || (course_group_ids.size == 0)
tip_exception("发布时间不能为空") if params[:publish_time].blank?
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("截止时间不能早于发布时间") if params[:publish_time].to_time > params[:end_time].to_time
tip_exception("截止时间必须晚于发布时间") if params[:publish_time].to_time >= params[:end_time].to_time
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time].to_time > @course.end_date.end_of_day

@ -15,11 +15,11 @@ class UpdateHomeworkPublishSettingService < ApplicationService
if params[:unified_setting] || course.course_groups_count == 0
tip_exception("发布时间不能为空") if params[:publish_time].blank?
tip_exception("截止时间不能为空") if params[:end_time].blank?
tip_exception("发布时间不能早于当前时间") if params[:publish_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= Time.now.strftime("%Y-%m-%d %H:%M:%S")
tip_exception("截止时间不能早于发布时间") if params[:publish_time] > params[:end_time]
tip_exception("发布时间不能早于当前时间") if params[:publish_time].to_time <= Time.now
tip_exception("截止时间不能早于当前时间") if params[:end_time].to_time <= Time.now
tip_exception("截止时间必须晚于发布时间") if params[:publish_time].to_time >= params[:end_time].to_time
tip_exception("截止时间不能晚于课堂结束时间(#{course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
course.end_date.present? && params[:end_time] > course.end_date.end_of_day
course.end_date.present? && params[:end_time].to_time > course.end_date.end_of_day
homework.unified_setting = 1
homework.homework_group_settings.destroy_all

@ -1,8 +0,0 @@
class MigrateCourseGroupMemberCount < ActiveRecord::Migration[5.2]
def change
CourseGroup.reset_column_information
CourseGroup.find_each do |group|
CourseGroup.reset_counters(group.id, :course_members_count)
end
end
end
Loading…
Cancel
Save