From 23ff5f64491c725d4fb435696c84d7cf36e92b26 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 30 Aug 2016 15:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E6=97=B6=E5=85=B7=E6=9C=89?= =?UTF-8?q?=E5=A4=9A=E9=87=8D=E8=BA=AB=E4=BB=BD=E7=9A=84=E6=95=99=E8=BE=85?= =?UTF-8?q?=E6=89=93=E7=9A=84=E5=88=86=E5=8F=98=E6=88=90=E4=BA=86=E2=80=9C?= =?UTF-8?q?=E6=88=91=E7=9A=84=E8=AF=84=E5=88=86=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/student_work_helper.rb | 8 ++++++-- app/views/student_work/_evaluation_work.html.erb | 2 +- app/views/student_work/_student_work_score.html.erb | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 4f0a2ca6d..2ecb5516f 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -22,8 +22,12 @@ module StudentWorkHelper end #获取指定用户对某一作业的评分结果 - def student_work_score work,user - StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last + def student_work_score work,user,reviewer_role=0 + if reviewer_role != 0 + StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id,:reviewer_role => reviewer_role).last + else + StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last + end end #获取指定评分的角色 diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index 6a7a69e36..c5db6a99f 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -81,7 +81,7 @@ <% end%> - <% my_score = student_work_score(student_work,User.current) %> + <% my_score = student_work_score(student_work,User.current,3) %> <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 64e5ffa01..3730c99fb 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -1,5 +1,5 @@