From ec4c7f531da0c38235482a5bde9572e231e3cb1b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Sep 2015 17:16:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E4=B8=9A=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_work.rb | 3 +-- app/views/student_work/_evaluation_un_work.html.erb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/student_work.rb b/app/models/student_work.rb index a6d641c0c..cd4d81a32 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -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 diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index caaaa2775..d3bac240d 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -57,7 +57,7 @@ - <% 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%>
  • <%= score.nil? ? "--" : format("%.1f",score)%> <% unless score.nil?%>