|
|
@ -572,10 +572,13 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
if @homework.homework_type == "practice"
|
|
|
|
if @homework.homework_type == "practice"
|
|
|
|
|
|
|
|
|
|
|
|
# 实训作业的评分设置
|
|
|
|
# 实训作业的评分设置
|
|
|
|
|
|
|
|
tip_exception("总分值不能为空") if params[:total_score].blank?
|
|
|
|
|
|
|
|
tip_exception("总分值不能小于0") if params[:total_score].to_i < 0
|
|
|
|
tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil?
|
|
|
|
tip_exception("缺少answer_open_evaluation参数") if params[:answer_open_evaluation].nil?
|
|
|
|
tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil?
|
|
|
|
tip_exception("缺少work_efficiency参数") if params[:work_efficiency].nil?
|
|
|
|
tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank?
|
|
|
|
tip_exception("缺少eff_score参数") if params[:work_efficiency] && params[:eff_score].blank?
|
|
|
|
tip_exception("效率分不能小于等于0") 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("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_i > params[:total_score].to_i
|
|
|
|
tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank?
|
|
|
|
tip_exception("缺少shixun_evaluation参数") if params[:shixun_evaluation].blank?
|
|
|
|
tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank?
|
|
|
|
tip_exception("缺少challenge_settings参数") if params[:challenge_settings].blank?
|
|
|
|
# tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank?
|
|
|
|
# tip_exception("缺少challenge_id参数") if params[:challenge_settings][:challenge_id].blank?
|
|
|
@ -584,6 +587,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
# params[:challenge_settings][:challenge_score].length != params[:challenge_settings][:challenge_id].length
|
|
|
|
# params[:challenge_settings][:challenge_score].length != params[:challenge_settings][:challenge_id].length
|
|
|
|
|
|
|
|
|
|
|
|
current_eff_score = @homework.eff_score
|
|
|
|
current_eff_score = @homework.eff_score
|
|
|
|
|
|
|
|
@homework.total_score = params[:total_score]
|
|
|
|
@homework.work_efficiency = params[:work_efficiency]
|
|
|
|
@homework.work_efficiency = params[:work_efficiency]
|
|
|
|
@homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_i : 0
|
|
|
|
@homework.eff_score = params[:work_efficiency] ? params[:eff_score].to_i : 0
|
|
|
|
|
|
|
|
|
|
|
|