<% if activity.homework_type == 3 && !is_teacher && activity.homework_detail_group.base_on_project == 1 && User.current.member_of_course?(activity.course)%>
    <% projects = cur_user_projects_for_homework activity %>
    <% works = cur_user_works_for_homework activity %>
    <% if works.nil? && projects.nil? %>
        <div class="homepagePostSubmit">
          <%=link_to "关联项目",new_student_work_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id),remote: true,:class=> 'c_blue', :title=> '请各组长关联作业项目' %>
        </div>
    <% elsif works.nil? %>
        <div class="homepagePostSubmit">
          <%=link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => activity.id,:hw_status=>hw_status,:user_activity_id=>user_activity_id), :confirm => "您确定要取消关联吗？", remote: true,:class => "c_blue", :title=> '取消关联项目' %>
        </div>
    <% end %>
<% end %>
<div class="homepagePostSubmit">
  <%= user_for_homework_common activity,is_teacher %>
</div>
<% work = cur_user_works_for_homework activity %>
<% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Date.today %>
    <div class="homepagePostSubmit">
      <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
    </div>
<% end %>
<% if activity.homework_type == 2 && is_teacher%>
    <div class="homepagePostSubmit">
      <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
    </div>
    <% if activity.homework_detail_manual.comment_status != 0 %>
        <div class="homepagePostSubmit">
          <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework: activity.id, course_id: activity.course.id), class: 'c_blue test-program-btn',:remote => true %>
        </div>
    <% end %>
<% end %>
<% if activity.homework_type == 2%>
    <div class="homepagePostDeadline mr15">
      语言：
      <%= activity.language_name%>
    </div>
<% end %>
<% if activity.homework_type == 3 && activity.homework_detail_group%>
    <div class="homepagePostDeadline mr15">
      分组人数：<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
    </div>
<% end %>