<% 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? %>
<%=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=> '请各组长关联作业项目' %>
<% elsif works.nil? %>
<%=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=> '取消关联项目' %>
<% end %> <% end %>
<%= user_for_homework_common activity,is_teacher %>
<% work = cur_user_works_for_homework activity %> <% if !is_teacher && !work.nil? && work.user == User.current && activity.end_time < Date.today %>
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
<% end %> <% if activity.homework_type == 2 && is_teacher%>
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: activity.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
<% if activity.homework_detail_manual.comment_status != 0 %>
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework: activity.id, course_id: activity.course.id), class: 'c_blue test-program-btn',:remote => true %>
<% end %> <% end %> <% if activity.homework_type == 2%>
语言: <%= activity.language_name%>
<% end %> <% if activity.homework_type == 3 && activity.homework_detail_group%> <% if activity.homework_detail_group.base_on_project == 1 %>
项目(<%=activity.student_work_projects.where("is_leader = 1").count %>)
<% end %>
分组人数:<%=activity.homework_detail_group.min_num %>-<%=activity.homework_detail_group.max_num %> 人
<% end %>