班级学生列表-导出列表:作业积分统计错误

This commit is contained in:
cxt 2016-11-01 17:25:02 +08:00
parent cbfde6596d
commit 4e267c22b3
1 changed files with 2 additions and 3 deletions

View File

@ -1511,9 +1511,8 @@ class CoursesController < ApplicationController
if student_works.empty?
sheet1[count_row,j+4] = 0
else
final_score = student_works.first.final_score.nil? ? 0 : student_works.first.final_score
score = final_score - student_works.first.absence_penalty - student_works.first.late_penalty
sheet1[count_row,j+4] = score <0 ? 0:score.round(2)
work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score
sheet1[count_row,j+4] = work_score <0 ? 0:work_score.round(2)
end
end
hw_score = member.score.nil? ? 0 : member.score