|
|
|
@ -540,7 +540,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
tip_exception("补交结束时间必须晚于截止时间") if params[:late_time] <= strf_time(@homework.end_time)
|
|
|
|
|
tip_exception("补交结束时间不能晚于课堂结束时间") if @course.end_date.present? && params[:late_time] >
|
|
|
|
|
strf_time(@course.end_date.end_of_day)
|
|
|
|
|
tip_exception("迟交扣分应为正整数") if params[:late_penalty] && params[:late_penalty].to_i < 0
|
|
|
|
|
tip_exception("迟交扣分不能小于0") if params[:late_penalty] && params[:late_penalty].to_i < 0
|
|
|
|
|
|
|
|
|
|
@homework.allow_late = true
|
|
|
|
|
@homework.late_time = params[:late_time]
|
|
|
|
@ -560,7 +560,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil?
|
|
|
|
|
tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil?
|
|
|
|
|
tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank?
|
|
|
|
|
tip_exception("效率分应为正整数") if params[:eff_score] && params[:eff_score].to_i < 0
|
|
|
|
|
tip_exception("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_i <= 0
|
|
|
|
|
tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank?
|
|
|
|
|
tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank?
|
|
|
|
|
# tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank?
|
|
|
|
@ -734,16 +734,16 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
if !@homework_detail_manual.final_mode
|
|
|
|
|
tip_exception("教师评分比例不能为空") if params[:te_proportion].blank?
|
|
|
|
|
te_proportion = params[:te_proportion].to_f.round(2)
|
|
|
|
|
tip_exception("教师评分比例不能小于零") if te_proportion < 0
|
|
|
|
|
tip_exception("教师评分比例不能小于0") if te_proportion < 0
|
|
|
|
|
tip_exception("助教评分比例不能为空") if params[:ta_proportion].blank?
|
|
|
|
|
ta_proportion = params[:ta_proportion].to_f.round(2)
|
|
|
|
|
tip_exception("助教评分比例不能小于零") if ta_proportion < 0
|
|
|
|
|
tip_exception("助教评分比例不能小于0") if ta_proportion < 0
|
|
|
|
|
if !@homework.anonymous_comment
|
|
|
|
|
tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion) > 1.0
|
|
|
|
|
else
|
|
|
|
|
tip_exception("学生评分比例不能为空") if params[:st_proportion].blank?
|
|
|
|
|
st_proportion = params[:st_proportion].to_f.round(2)
|
|
|
|
|
tip_exception("学生评分比例不能小于零") if st_proportion < 0
|
|
|
|
|
tip_exception("学生评分比例不能小于0") if st_proportion < 0
|
|
|
|
|
tip_exception("评分比例之和不能大于100") if (te_proportion + ta_proportion + st_proportion) > 1.0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|