diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 02bdde103..75a0eb3f1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -42,6 +42,11 @@ module ApplicationHelper number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number 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 不显示 def hidden_unproject_infos diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index ac3c847a9..65aad5e04 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -86,19 +86,27 @@ <%= user.user_extensions.student_id %> - <%= link_to format("%0.2f", hw_score), { - :action => 'show_member_score', - :member_id => member.id, - :remote => true}, - :class => "" %> + <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %> + ** + <% else %> + <%= link_to format("%0.2f", hw_score), { + :action => 'show_member_score', + :member_id => member.id, + :remote => true}, + :class => "" %> + <% end %> <%= ex_score %> - <%= link_to act_score, { - :action => 'show_member_act_score', - :member_id => member.id, - :remote => true}, - :class => '' %> + <% if !is_teacher && User.current.id != member.user_id && course_has_score_open_common_homework(@course) %> + ** + <% else %> + <%= link_to act_score, { + :action => 'show_member_act_score', + :member_id => member.id, + :remote => true}, + :class => '' %> + <% end %> <%= format("%0.2f", sum) %>