From 2fa58de30209b028d2cfaf550f6185e1d25f13da Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 3 Jul 2015 15:05:46 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=BB=93=E6=9E=9C?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/poll_result.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/poll/poll_result.html.erb b/app/views/poll/poll_result.html.erb
index 47f3b179d..4145ec1b2 100644
--- a/app/views/poll/poll_result.html.erb
+++ b/app/views/poll/poll_result.html.erb
@@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
-
+
<%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %>
From 3cfb77e98e86114689a4137b4b0c54ec06b7fbb8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 3 Jul 2015 15:43:17 +0800
Subject: [PATCH 2/3] =?UTF-8?q?1=E3=80=81=E6=9C=80=E7=BB=88=E6=88=90?=
=?UTF-8?q?=E7=BB=A9=E6=8F=90=E7=A4=BA=E6=A1=86=E4=BF=9D=E7=95=992?=
=?UTF-8?q?=E4=BD=8D=E6=95=B0=E5=AD=97=202=E3=80=81=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E8=BF=9F=E4=BA=A4=E6=89=A3=E5=88=86=E6=97=B6=EF=BC=8C=E8=BF=9F?=
=?UTF-8?q?=E4=BA=A4=E4=BD=9C=E5=93=81=E8=AE=A1=E7=AE=97=E6=9C=89=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 2 +-
app/views/student_work/_student_work.html.erb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 7808691cf..c0685ea0a 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -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
diff --git a/app/views/student_work/_student_work.html.erb b/app/views/student_work/_student_work.html.erb
index 6e4cc65f1..c555b36a9 100644
--- a/app/views/student_work/_student_work.html.erb
+++ b/app/views/student_work/_student_work.html.erb
@@ -52,7 +52,7 @@
缺评扣分
<%= student_work.absence_penalty%> 分,
最终成绩为
- <%= score%> 分。
+ <%= format("%.1f",score)%> 分。
<% else%>
@@ -62,7 +62,7 @@
迟交扣分
<%= student_work.late_penalty%> 分,
最终成绩为
-
<%= score%> 分。
+
<%= format("%.1f",score)%> 分。
<% end%>
<% end%>
From 9ee9b0277c7edbb9e04d29c0e26d67736d5bcd7a Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 3 Jul 2015 17:30:08 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E7=BC=BA=E8=AF=84=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 596d5ba51..63d25acbd 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -278,7 +278,7 @@ class StudentWorkController < ApplicationController
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
@stundet_works = StudentWork.find_by_sql("SELECT * FROM (SELECT *,(all_count - has_count) AS absence FROM(
SELECT * ,
- (SELECT evaluation_num FROM homework_detail_manuals WHERE homework_detail_manuals.homework_common_id = #{@homework.id}) AS all_count,
+ (SELECT COUNT(*) FROM `student_works_evaluation_distributions` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS all_count,
(SELECT COUNT(*) FROM `student_works_scores` WHERE user_id = student_works.user_id AND student_work_id IN #{work_ids}) AS has_count
FROM `student_works`
WHERE homework_common_id = #{@homework.id}