计算缺评成绩

dev_course
cxt 5 years ago
parent 6628269df1
commit 1ab3938813

@ -11,7 +11,7 @@ class HomeworkAbsencePenaltyCalculationJob < ApplicationJob
homework_common.student_works.where("work_status != 0").each do |student_work| homework_common.student_works.where("work_status != 0").each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where(student_work_id: work_ids).count - absence_penalty_count = student_work.user.student_works_evaluation_distributions.where(student_work_id: work_ids).count -
student_work.user.student_works_scores.where(student_work_id: work_ids, reviewer_role: 3).group_by(:student_work_id).count student_work.user.student_works_scores.where(student_work_id: work_ids, reviewer_role: 3).group_by(&:student_work_id).count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save student_work.save

Loading…
Cancel
Save