匿评时具有多重身份的教辅打的分变成了“我的评分”

cxt_course
cxt 9 years ago
parent 623dadaea1
commit 23ff5f6449

@ -22,9 +22,13 @@ module StudentWorkHelper
end end
#获取指定用户对某一作业的评分结果 #获取指定用户对某一作业的评分结果
def student_work_score work,user 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 StudentWorksScore.where(:user_id => user.id,:student_work_id => work.id).last
end end
end
#获取指定评分的角色 #获取指定评分的角色
def student_work_score_role score def student_work_score_role score

@ -81,7 +81,7 @@
</td> </td>
<% end%> <% end%>
<% my_score = student_work_score(student_work,User.current) %> <% my_score = student_work_score(student_work,User.current,3) %>
<td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10"> <td class="hworkList70 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10 ml10">
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%> <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
</td> </td>

@ -1,5 +1,5 @@
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl"> <ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) %> <% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) || score.reviewer_role != 3 %>
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %> <%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
<div class="pingBoxTit"> <div class="pingBoxTit">
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %> <%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>

Loading…
Cancel
Save