|
|
@ -379,6 +379,7 @@ class ExercisesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
#试卷的提交设置
|
|
|
|
#试卷的提交设置
|
|
|
|
def commit_setting
|
|
|
|
def commit_setting
|
|
|
|
|
|
|
|
tip_exception("助教无权限修改本试卷") if @user_course_identity == Course::ASSISTANT_PROFESSOR && !@exercise.assistant_auth
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
error_count = 0 # 判断循环里是否有已发布/已截止的,且时间更改了的分班。
|
|
|
|
error_count = 0 # 判断循环里是否有已发布/已截止的,且时间更改了的分班。
|
|
|
|
# course_group_ids = @course.teacher_course_group_ids(current_user.id) #当前老师的班级id数组
|
|
|
|
# course_group_ids = @course.teacher_course_group_ids(current_user.id) #当前老师的班级id数组
|
|
|
@ -398,6 +399,7 @@ class ExercisesController < ApplicationController
|
|
|
|
choice_random = params[:choice_random] ? true : false
|
|
|
|
choice_random = params[:choice_random] ? true : false
|
|
|
|
score_open = params[:score_open] ? true : false #分数是否公开
|
|
|
|
score_open = params[:score_open] ? true : false #分数是否公开
|
|
|
|
answer_open = params[:answer_open] ? true : false #答案是否公开
|
|
|
|
answer_open = params[:answer_open] ? true : false #答案是否公开
|
|
|
|
|
|
|
|
assistant_auth = params[:assistant_auth] ? true : false # 助教权限
|
|
|
|
|
|
|
|
|
|
|
|
# 统一设置或者分班为0,则更新试卷,并删除试卷分组
|
|
|
|
# 统一设置或者分班为0,则更新试卷,并删除试卷分组
|
|
|
|
if unified_setting || (course_group_ids.size == 0)
|
|
|
|
if unified_setting || (course_group_ids.size == 0)
|
|
|
@ -426,7 +428,8 @@ class ExercisesController < ApplicationController
|
|
|
|
:answer_open => answer_open,
|
|
|
|
:answer_open => answer_open,
|
|
|
|
:exercise_status => exercise_status_n,
|
|
|
|
:exercise_status => exercise_status_n,
|
|
|
|
:publish_time => params_publish_time,
|
|
|
|
:publish_time => params_publish_time,
|
|
|
|
:end_time => params_end_time
|
|
|
|
:end_time => params_end_time,
|
|
|
|
|
|
|
|
:assistant_auth => assistant_auth
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@exercise.update!(exercise_params)
|
|
|
|
@exercise.update!(exercise_params)
|
|
|
|
@exercise.exercise_group_settings.destroy_all
|
|
|
|
@exercise.exercise_group_settings.destroy_all
|
|
|
|