<% 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 %>
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %>
<% if is_teacher%>
    • <%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => 0), :class => "postOptionLink"%>
    • <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => 0),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
    • <%= link_to("评分设置", score_rule_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => 0),:class => "postOptionLink", :remote => true) %>
    • <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
    • <%= homework_anonymous_comment activity %>
<% end%>
<% count=activity.journals_for_messages.count %>
回复(<%= count %>)
<%if count>3 %> <% end %>
<% replies_all_i = 0 %> <% if count > 0 %>
    <% activity.journals_for_messages.reorder("created_on desc").each do |comment| %> <% replies_all_i = replies_all_i + 1 %>
  • <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
    <% if comment.try(:user).try(:realname) == ' ' %> <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <% else %> <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_time(comment.created_on) %>
    <%= comment.notes.html_safe %>
  • <% end %>
<% end %>
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>

<% end%>