<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <% else %> <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %> <% end %> TO <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
<% if activity.homework_detail_manual.comment_status == 1%> 未开启匿评 <% elsif activity.homework_detail_manual.comment_status == 2%> 匿评中 <% elsif activity.homework_detail_manual.comment_status == 3%> 匿评已结束 <% end%>
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %> <%= user_for_homework_common activity,is_teacher %>
<% 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: '教师可以通过模拟答题设置作业的标准答案' %>
<% end %> <% if activity.homework_type == 2%>
语言: <%= activity.language_name%>
<% end %>
截止时间:<%= activity.end_time.to_s %>
<%= activity.description.html_safe %>
<%# if is_teacher%>