迟交扣分:<%= activity.late_penalty%>分
<% if activity.anonymous_comment == 0%>
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
<% end %>
<% if activity.anonymous_comment == 0%>
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
<% end %>
<% if activity.student_works.has_committed.count != 0 %> <% sw = activity.student_works.has_committed.reorder("commit_time desc").first %>
# <%=time_from_now sw.commit_time %><%= link_to sw.user.show_name, user_activities_path(sw.user_id), :class => "newsBlue ml5 mr5"%>提交了作品
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> <%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %> <% unless student_work_scores.empty? %> <% last_score = student_work_scores.first %>

# <%=time_from_now last_score.created_at %> <%= link_to last_score.user.show_name, user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:

<% end %>
<% student_works = activity.student_works.select("student_works.*,student_works.work_score as score").where("work_score is not null and work_status != 0").order("score desc").limit(5) %> <% student_works.includes(:user).each do |sw| %>
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_url_in_org(activity.id, 2, '', sw.id), :alt => "学生头像" %> <% else %> <%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %> <% end %> <% score = sw.respond_to?("score") ? sw.score : sw.work_score %>

分数:<%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分

<% end %> <% if student_works.count == 5 %> <%= link_to "更多>>", student_work_index_url_in_org(activity.id, 2),:class=>'linkGrey2 fl ml50',:style=>'margin-top:60px;'%> <% end %>
<% end %>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1 %> <% projects = activity.student_work_projects.where("is_leader = 1") %> <% unless projects.empty? %> <% sort_projects = project_sort_update projects %>
<% first_pro_act = sort_projects.first %> <% first_pro = Project.find first_pro_act.project_id %> <% commit_time = first_pro.project_score.commit_time %> <%# one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(first_pro_act.updated_at) ? commit_time : first_pro_act.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目
<% end %> <% end %>
<% if is_teacher%> <% comment_status = activity.homework_detail_manual.comment_status %>
<% end%>