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 @@