1、最终成绩提示框保留2位数字

2、修改迟交扣分时,迟交作品计算有问题
This commit is contained in:
sw 2015-07-03 15:43:17 +08:00
parent 2fa58de302
commit 3cfb77e98e
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class HomeworkCommonController < ApplicationController
@homework.publish_time = params[:homework_common][:publish_time]
@homework.homework_type = params[:homework_common][:homework_type]
unless @homework.late_penalty == params[:late_penalty]
@homework.student_works.where("created_at > #{@homework.end_time}").each do |student_work|
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = params[:late_penalty]
student_work.save
end

View File

@ -52,7 +52,7 @@
缺评扣分
<span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分,
最终成绩为
<span class="c_red">&nbsp;<%= score%>&nbsp;</span>分。
<span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
</div>
<% else%>
<!-- 非匿评作品不显示缺评扣分 -->
@ -62,7 +62,7 @@
迟交扣分
<span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分,
最终成绩为
<span class="c_red">&nbsp;<%= score%>&nbsp;</span>分。
<span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
</div>
<% end%>
<% end%>