From c710b366ceb8e5be3564d4b0189bc60f7bdcbc09 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 5 Dec 2019 14:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 6 +++--- app/controllers/weapps/homework_commons_controller.rb | 2 +- app/services/update_homework_publish_setting_service.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 4a31fc474..1c19c745f 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -453,7 +453,7 @@ class HomeworkCommonsController < ApplicationController # 课堂结束后不能再更新 unless @course.is_end - UpdateHomeworkSettingService.call(@homework, publish_params) + UpdateHomeworkPublishSettingService.call(@homework, publish_params) # 作业未发布时,unified_setting参数不能为空 =begin if @homework.publish_time.nil? || @homework.publish_time > Time.now @@ -585,8 +585,8 @@ 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("效率分不能小于等于0") if params[:eff_score] && params[:eff_score].to_f <= 0 - tip_exception("效率分不能大于总分值") if params[:eff_score] && params[:eff_score].to_f.round(2) > params[:total_score].to_f.round(2) + tip_exception("效率分不能小于等于0") if params[:work_efficiency] && params[:eff_score] && params[:eff_score].to_f <= 0 + tip_exception("效率分不能大于总分值") if params[:work_efficiency] && params[:eff_score] && params[:eff_score].to_f.round(2) > params[:total_score].to_f.round(2) 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? diff --git a/app/controllers/weapps/homework_commons_controller.rb b/app/controllers/weapps/homework_commons_controller.rb index 00d2ce926..3f74d6ba4 100644 --- a/app/controllers/weapps/homework_commons_controller.rb +++ b/app/controllers/weapps/homework_commons_controller.rb @@ -7,7 +7,7 @@ class Weapps::HomeworkCommonsController < Weapps::BaseController begin # 课堂结束后不能再更新 if @course.is_end - UpdateHomeworkSettingService.call(@homework, publish_params) + UpdateHomeworkPublishSettingService.call(@homework, publish_params) else tip_exception("课堂已结束不能再更新") end diff --git a/app/services/update_homework_publish_setting_service.rb b/app/services/update_homework_publish_setting_service.rb index 8c54a15b6..3ada2fbc4 100644 --- a/app/services/update_homework_publish_setting_service.rb +++ b/app/services/update_homework_publish_setting_service.rb @@ -1,4 +1,4 @@ -class UpdateHomeworkSettingService < ApplicationService +class UpdateHomeworkPublishSettingService < ApplicationService attr_reader :homework, :params def initialize(homework, params)