迟交扣分:<%= 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%>分/作品
<% end %> <% if activity.anonymous_comment == 0%>
匿评关闭时间:<%= 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"%>提交了作品
<% end %>
<% if activity.student_works.count != 0 %> <% 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 %>
<% if activity.homework_type != 2 %> <% ids = student_work_scores.empty? ? "(-1)" : '('+student_work_scores.map{|sw|sw.student_work_id}.join(',')+')' %> <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").where("student_works.id in #{ids}").order("score desc") %> <% else %> <% student_works = activity.student_works.has_committed.select("student_works.*,student_works.work_score as score").order("score desc") %> <% end %> <% student_works.includes(:user).each_with_index do |sw, i| %>
<% 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.final_score || 0) - sw.absence_penalty - sw.late_penalty %>

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

<% if i == 4 %> <% break %> <% end %> <% 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 = sort_projects.first %> <% first_pro = Project.find sort_projects.first.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(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
<% sort_projects.each_with_index do |pro, i| %> <% project = Project.find pro.project_id %>
<% com_time = project.project_score.commit_time %> <% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %> <% if project.is_public || User.current.member_of?(project) || User.current.admin? %> <%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %> <% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <% else %> <%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %> <% end %>
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<% if i == 9 && projects.count > 10 %> 更多>> <% end %> <% if i > 9 && i == (projects.count - 1) %> 收回<< <% end %> <% end %>
<% end %> <% end %>
<% if is_teacher%> <% comment_status = activity.homework_detail_manual.comment_status %>
<% end%>