|
|
|
@ -4,6 +4,7 @@ class Ecs::QueryCourseEvaluationService < ApplicationService
|
|
|
|
|
def initialize(ec_course)
|
|
|
|
|
@ec_course = ec_course
|
|
|
|
|
@_course_achievement = 0
|
|
|
|
|
@_course_rate = 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def course_targets
|
|
|
|
@ -16,6 +17,12 @@ class Ecs::QueryCourseEvaluationService < ApplicationService
|
|
|
|
|
@_course_achievement.round(2)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def course_rate
|
|
|
|
|
course_targets
|
|
|
|
|
|
|
|
|
|
@_course_rate.round(2)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def graduation_subitem_evaluations
|
|
|
|
|
student_scores = ec_course.ec_course_student_scores.joins(ec_student_score_targets: :ec_course_target).group(:ec_course_target_id)
|
|
|
|
|
student_scores = student_scores.select('AVG(score) as average_score, ec_course_target_id')
|
|
|
|
@ -96,6 +103,7 @@ class Ecs::QueryCourseEvaluationService < ApplicationService
|
|
|
|
|
|
|
|
|
|
# 计算总评成绩
|
|
|
|
|
@_course_achievement += data[:average_score].to_f * course_target.weight.to_f
|
|
|
|
|
@_course_rate += course_target.weight.to_f
|
|
|
|
|
|
|
|
|
|
# 计算学生成绩分布区间
|
|
|
|
|
student_count = 0
|
|
|
|
|