|
|
|
@ -452,22 +452,27 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
tip_exception("评阅时间应当大于截止时间") if @task.cross_comment && params[:comment_time] <= @task.end_time
|
|
|
|
|
|
|
|
|
|
@task.comment_time = @task.cross_comment ? params[:comment_time] : nil
|
|
|
|
|
@task.comment_num = @task.cross_comment ? params[:comment_num].to_i : 3
|
|
|
|
|
@task.comment_status = @task.cross_comment ? params[:comment_status] : 0
|
|
|
|
|
if @task.cross_comment && params[:comment_status].to_i == 4
|
|
|
|
|
tip_exception("评阅数不能为空") if params[:comment_num].blank?
|
|
|
|
|
tip_exception("评阅数应大于0") if params[:comment_num].to_i < 1
|
|
|
|
|
|
|
|
|
|
@course.graduation_groups.each_with_index do |group, index|
|
|
|
|
|
ass_group = @task.graduation_task_group_assignations.find_by(graduation_group_id: group.id)
|
|
|
|
|
if ass_group.present? && params[:comment_group][index].present? && params[:comment_group][index] != "0"
|
|
|
|
|
ass_group.update_attributes(assign_graduation_group_id: params[:comment_group][index])
|
|
|
|
|
else
|
|
|
|
|
@task.graduation_task_group_assignations << GraduationTaskGroupAssignation.new(graduation_group_id: group.id,
|
|
|
|
|
assign_graduation_group_id: params[:comment_group][index])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# unless @task.cross_comment
|
|
|
|
|
# @task.graduation_work_comment_assignations.destroy_all
|
|
|
|
|
# end
|
|
|
|
|
# 去掉评阅设置
|
|
|
|
|
# @task.comment_num = @task.cross_comment ? params[:comment_num].to_i : 3
|
|
|
|
|
# @task.comment_status = @task.cross_comment ? params[:comment_status] : 0
|
|
|
|
|
# if @task.cross_comment && params[:comment_status].to_i == 4
|
|
|
|
|
# tip_exception("评阅数不能为空") if params[:comment_num].blank?
|
|
|
|
|
# tip_exception("评阅数应大于0") if params[:comment_num].to_i < 1
|
|
|
|
|
#
|
|
|
|
|
# @course.graduation_groups.each_with_index do |group, index|
|
|
|
|
|
# ass_group = @task.graduation_task_group_assignations.find_by(graduation_group_id: group.id)
|
|
|
|
|
# if ass_group.present? && params[:comment_group][index].present? && params[:comment_group][index] != "0"
|
|
|
|
|
# ass_group.update_attributes(assign_graduation_group_id: params[:comment_group][index])
|
|
|
|
|
# else
|
|
|
|
|
# @task.graduation_task_group_assignations << GraduationTaskGroupAssignation.new(graduation_group_id: group.id,
|
|
|
|
|
# assign_graduation_group_id: params[:comment_group][index])
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 公开设置
|
|
|
|
@ -492,6 +497,10 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def cross_comment_setting
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def find_task
|
|
|
|
|
begin
|
|
|
|
|