|
|
|
@ -514,6 +514,9 @@ class ExercisesController < ApplicationController
|
|
|
|
|
if exercise_group.present? && (exercise_group.first.publish_time < Time.now) && (exercise_publish_time != exercise_group.first.publish_time)
|
|
|
|
|
error_count += 1
|
|
|
|
|
end
|
|
|
|
|
if exercise_group.present? && (exercise_group.first.publish_time < Time.now && exercise_group.first.end_time > Time.now) && (exercise_end_time < Time.now)
|
|
|
|
|
error_count += 1
|
|
|
|
|
end
|
|
|
|
|
if error_count == 0
|
|
|
|
|
common_group = exercise_groups_ids & course_id #传入的班级与问卷已存在的班级的交集,即表示已有分班的
|
|
|
|
|
new_group_ids = course_id - common_group #新传入的班级id
|
|
|
|
@ -529,12 +532,12 @@ class ExercisesController < ApplicationController
|
|
|
|
|
if the_group_setting_status == 2
|
|
|
|
|
ex_group_params = {
|
|
|
|
|
:publish_time => the_group_setting.publish_time,
|
|
|
|
|
:end_time => exercise_end_time
|
|
|
|
|
:end_time => exercise_end_time < Time.now ? the_group_setting.end_time : exercise_end_time
|
|
|
|
|
}
|
|
|
|
|
elsif the_group_setting_status == 3
|
|
|
|
|
ex_group_params = {
|
|
|
|
|
:publish_time => the_group_setting.publish_time,
|
|
|
|
|
:end_time => the_group_setting.end_time
|
|
|
|
|
:end_time => exercise_end_time
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
the_group_setting.update_attributes!(ex_group_params)
|
|
|
|
@ -558,7 +561,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
if error_count > 0
|
|
|
|
|
error_count == 0
|
|
|
|
|
normal_status(-1,"已发布/已截止的试卷不允许修改时间")
|
|
|
|
|
normal_status(-1,"试卷发布/截止时间不能小于当前时间")
|
|
|
|
|
else
|
|
|
|
|
# 未发布的分班设置才能删除
|
|
|
|
|
if old_exercise_groups.size > 0
|
|
|
|
|