匿评作业成绩计算错误

This commit is contained in:
sw 2015-09-18 17:16:31 +08:00
parent 20b4c056a8
commit ec4c7f531d
2 changed files with 2 additions and 3 deletions

View File

@ -31,9 +31,8 @@ class StudentWork < ActiveRecord::Base
else
self.system_score = last_test.test_score
end
set_final_score self.homework_common,self
end
set_final_score self.homework_common,self
end
def set_src
self.description = last_test.src if last_test

View File

@ -57,7 +57,7 @@
</li>
<!-- 成绩 -->
<% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%>
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
<%= score.nil? ? "--" : format("%.1f",score)%>
<% unless score.nil?%>