dev_newshixunModel
p31729568 5 years ago
parent 20affc7a40
commit 3aa2c03d01

@ -19,7 +19,9 @@ class Ecs::CourseTargetsController < Ecs::CourseBaseController
end
def with_achievement_methods
@course_targets = current_course.ec_course_targets.includes(:ec_graduation_subitems, :ec_course_achievement_methods)
@course_targets = current_course.ec_course_targets
.includes(:ec_graduation_subitems,
ec_course_achievement_methods: [:ec_course_evaluation, :ec_course_evaluation_subitems])
end
private

@ -29,7 +29,7 @@ class Ecs::QueryCourseEvaluationService < ApplicationService
support = subitem.ec_course_supports.find_by(ec_course_id: ec_course.id)
weight = support.weights.to_f
weight = support&.weights.to_f
objective_achievement = (weight * ec_course.ec_year.calculation_value.to_f).round(3)
target_total_rates = 0

@ -1 +1 @@
json.extract! ec_course_evaluation, :id, :name, :evaluation_count, :status
json.extract! ec_course_evaluation, :id, :name, :evluation_count, :status

Loading…
Cancel
Save