From 42d706a9618570f18f2a748afc701ee4d02c5086 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Sat, 18 Jul 2015 10:44:26 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=89=A3?=
=?UTF-8?q?=E5=88=86=E8=A7=84=E5=88=99=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 28 +++++++++++++++++++++++++++
app/helpers/homework_common_helper.rb | 27 --------------------------
app/views/student_work/index.html.erb | 9 ++-------
3 files changed, 30 insertions(+), 34 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7b3d7bbe2..64a478187 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2347,4 +2347,32 @@ module ApplicationHelper
def text_format text
text.gsub("&","&").gsub("<","<").gsub(">",">").gsub("\n","
").html_safe
end
+
+ #评分规则显示
+ def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil
+ if absence_penalty
+ if late_penalty.to_i == 0 && absence_penalty.to_i == 0
+ notice = "尚未设置评分规则"
+ if is_teacher
+ notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
+ end
+ elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0
+ notice = "迟交扣#{late_penalty}分,缺评扣分未设置"
+ elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0
+ notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}分"
+ elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0
+ notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}分"
+ end
+ else
+ if late_penalty.to_i == 0
+ notice = "尚未设置评分规则"
+ if is_teacher
+ notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
+ end
+ else
+ notice = "迟交扣#{late_penalty}分"
+ end
+ end
+ notice.html_safe
+ end
end
diff --git a/app/helpers/homework_common_helper.rb b/app/helpers/homework_common_helper.rb
index a2ff6dbab..81f817ee9 100644
--- a/app/helpers/homework_common_helper.rb
+++ b/app/helpers/homework_common_helper.rb
@@ -53,31 +53,4 @@ module HomeworkCommonHelper
link
end
- #评分规则显示
- def scoring_rules late_penalty,homework_id,is_teacher,absence_penalty=nil
- if absence_penalty
- if late_penalty.to_i == 0 && absence_penalty.to_i == 0
- notice = "尚未设置评分规则"
- if is_teacher
- notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
- end
- elsif late_penalty.to_i != 0 && absence_penalty.to_i == 0
- notice = "迟交扣#{late_penalty}分,缺评扣分未设置"
- elsif late_penalty.to_i == 0 && absence_penalty.to_i != 0
- notice = "迟交扣分未设置,缺评一个作品扣#{absence_penalty}分"
- elsif late_penalty.to_i != 0 && absence_penalty.to_i != 0
- notice = "迟交扣#{late_penalty}分,缺评一个作品扣#{absence_penalty}分"
- end
- else
- if late_penalty.to_i == 0
- notice = "尚未设置评分规则"
- if is_teacher
- notice += ",请 " + link_to("设置",edit_homework_common_path(homework_id),:class => "c_green")
- end
- else
- notice = "迟交扣#{late_penalty}分"
- end
- end
- notice.html_safe
- end
end
\ No newline at end of file
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index 1eaee54af..7e4a818a9 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -165,15 +165,10 @@