实训作业的最大效率值

dev_course
cxt 6 years ago
parent 40979e7b2c
commit 555b1f8dc0

@ -111,7 +111,7 @@ class HomeworksService
if homework.work_efficiency
if homework.max_efficiency < student_work.efficiency
# homework.max_efficiency = student_work.efficiency
homework.update_column("max_efficiency", homework.max_efficiency)
homework.update_column("max_efficiency", student_work.efficiency)
end
# eff_score = homework.max_efficiency == 0 ? 0 : student_work.efficiency / homework.max_efficiency * homework.eff_score
# student_work.eff_score = format("%.2f", eff_score)
@ -200,7 +200,7 @@ class HomeworksService
# 如果作业的最大效率值有变更则更新所有作品的效率分
if homework.work_efficiency && homework.max_efficiency < work.efficiency
homework.update_column("max_efficiency", homework.max_efficiency)
homework.update_column("max_efficiency", work.efficiency)
end
end

Loading…
Cancel
Save