2016-03-21 16:50:24 +08:00
|
|
|
<% hero_homework_scores = hero_homework_score(course, "desc") %>
|
|
|
|
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
|
|
|
<ul class="rankList">
|
2016-07-22 15:32:37 +08:00
|
|
|
<h4 style="font-size: 14px; font-weight: normal;">
|
2016-06-01 14:58:59 +08:00
|
|
|
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
2017-02-13 16:02:11 +08:00
|
|
|
<%= link_to "英雄榜", course_statistics_course_path(@course, :tab => 2), :class => 'fontGrey3' %>
|
2016-06-01 14:58:59 +08:00
|
|
|
<% else %>
|
2016-12-09 10:12:05 +08:00
|
|
|
<span class="fontGrey7">英雄榜</span>
|
2016-06-01 14:58:59 +08:00
|
|
|
<% end %>
|
2016-12-12 13:52:18 +08:00
|
|
|
</h4>
|
|
|
|
|
2016-03-21 16:50:24 +08:00
|
|
|
<% hero_homework_scores.each do |student_score| %>
|
|
|
|
<% if student_score.score.to_i != 0 %>
|
2016-12-03 11:20:50 +08:00
|
|
|
<li> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
|
|
|
|
<p><a href="javascript:void(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
|
|
|
|
<p><span class="c_red" style="cursor:pointer" >
|
|
|
|
<% if !(User.current.allowed_to?(:as_teacher, @course) || User.current.admin?) && User.current.id != student_score.user.id && course_has_score_open_common_homework(@course) %>
|
|
|
|
<%= "**" %>
|
|
|
|
<% else %>
|
|
|
|
<%= student_score.score<0 ? 0 : student_score.score.to_i %>
|
|
|
|
<% end %>
|
|
|
|
</span></p>
|
2016-03-21 16:50:24 +08:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</ul>
|
|
|
|
<% end %>
|