|
|
|
@ -850,10 +850,11 @@ class ExercisesController < ApplicationController
|
|
|
|
|
g_course = params[:group_ids]
|
|
|
|
|
if g_course.present?
|
|
|
|
|
teacher_course_group_ids = @course.charge_group_ids(current_user)
|
|
|
|
|
if g_course.map(&:to_i).sort == teacher_course_group_ids.sort #开始为统一设置
|
|
|
|
|
all_course_group_ids = @course.course_groups.pluck(:id)
|
|
|
|
|
if exercise.unified_setting && g_course.map(&:to_i).sort == all_course_group_ids.sort #开始为统一设置
|
|
|
|
|
exercise.exercise_group_settings.destroy_all
|
|
|
|
|
new_ex_status = set_exercise_status(exercise.publish_time,Time.now)
|
|
|
|
|
exercise.update_attributes(:end_time => Time.now,:unified_setting => true,:exercise_status => new_ex_status)
|
|
|
|
|
exercise.update_attributes(:end_time => Time.now,:exercise_status => new_ex_status)
|
|
|
|
|
exercise_users = exercise.exercise_users
|
|
|
|
|
else
|
|
|
|
|
course_members_ids = course_students.course_find_by_ids("course_group_id",g_course).pluck(:user_id).uniq #该班级的全部学生
|
|
|
|
|