学生列表得分显示

This commit is contained in:
huang 2016-12-03 10:56:35 +08:00
parent 9d00979647
commit 20e07bb1ba
2 changed files with 23 additions and 10 deletions

View File

@ -42,6 +42,11 @@ module ApplicationHelper
number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number
end end
# 判断某个课程是否包含仅对自己可见的作业
def course_has_score_open_common_homework course
course.homework_commons.select{|hc| hc.score_open == 0}.count > 0 ? true : false
end
# 隐藏项目以外的信息 # 隐藏项目以外的信息
# return: true 显示false 不显示 # return: true 显示false 不显示
def hidden_unproject_infos def hidden_unproject_infos

View File

@ -86,19 +86,27 @@
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span> <span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
</td> </td>
<td> <td>
<%= link_to format("%0.2f", hw_score), { <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>
:action => 'show_member_score', <a>**</a>
:member_id => member.id, <% else %>
:remote => true}, <%= link_to format("%0.2f", hw_score), {
:class => "" %> :action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => "" %>
<% end %>
</td> </td>
<td><%= ex_score %></td> <td><%= ex_score %></td>
<td> <td>
<%= link_to act_score, { <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %>
:action => 'show_member_act_score', <a>**</a>
:member_id => member.id, <% else %>
:remote => true}, <%= link_to act_score, {
:class => '' %> :action => 'show_member_act_score',
:member_id => member.id,
:remote => true},
:class => '' %>
<% end %>
</td> </td>
<td class="pr"> <td class="pr">
<span class="sum_score_tip"><%= format("%0.2f", sum) %></span> <span class="sum_score_tip"><%= format("%0.2f", sum) %></span>