|
|
@ -703,12 +703,14 @@ class ExercisesController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if ex_status == 1 #如果试卷存在已发布的,或者是已截止的,那么则直接跳过
|
|
|
|
if ex_status == 1 #如果试卷存在已发布的,或者是已截止的,那么则直接跳过
|
|
|
|
g_course = params[:group_ids] #表示是否传入分班参数,如果传入分班的参数,那么试卷的统一设置需修改
|
|
|
|
g_course = params[:group_ids] #表示是否传入分班参数,如果传入分班的参数,那么试卷的统一设置需修改
|
|
|
|
|
|
|
|
tiding_group_ids = g_course
|
|
|
|
if g_course
|
|
|
|
if g_course
|
|
|
|
user_course_groups = @course.charge_group_ids(current_user)
|
|
|
|
user_course_groups = @course.charge_group_ids(current_user)
|
|
|
|
if g_course.map(&:to_i).sort == user_course_groups.sort # 如果是设置为全部班级,则试卷不用分组,且试卷设定为统一设置,否则则分组设置
|
|
|
|
if g_course.map(&:to_i).sort == user_course_groups.sort # 如果是设置为全部班级,则试卷不用分组,且试卷设定为统一设置,否则则分组设置
|
|
|
|
exercise.exercise_group_settings.destroy_all
|
|
|
|
exercise.exercise_group_settings.destroy_all
|
|
|
|
ex_unified = true
|
|
|
|
ex_unified = true
|
|
|
|
e_time = ex_end_time
|
|
|
|
e_time = ex_end_time
|
|
|
|
|
|
|
|
tiding_group_ids = []
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ex_unified = false
|
|
|
|
ex_unified = false
|
|
|
|
g_course.each do |i|
|
|
|
|
g_course.each do |i|
|
|
|
@ -748,7 +750,7 @@ class ExercisesController < ApplicationController
|
|
|
|
if exercise.course_acts.size == 0
|
|
|
|
if exercise.course_acts.size == 0
|
|
|
|
exercise.course_acts << CourseActivity.new(:user_id => exercise.user_id,:course_id => exercise.course_id)
|
|
|
|
exercise.course_acts << CourseActivity.new(:user_id => exercise.user_id,:course_id => exercise.course_id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
ExercisePublishNotifyJob.perform_later(exercise.id, g_course)
|
|
|
|
ExercisePublishNotifyJob.perform_later(exercise.id, tiding_group_ids)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -1084,6 +1086,7 @@ class ExercisesController < ApplicationController
|
|
|
|
:subjective_score => subjective_score
|
|
|
|
:subjective_score => subjective_score
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@answer_committed_user.update_attributes(commit_option)
|
|
|
|
@answer_committed_user.update_attributes(commit_option)
|
|
|
|
|
|
|
|
CommitExercsieNotifyJobJob.perform_later(@exercise.id, current_user.id)
|
|
|
|
normal_status(0,"试卷提交成功!")
|
|
|
|
normal_status(0,"试卷提交成功!")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|