<% 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%> <% if activity.homework_detail_manual.comment_status == 1%> <% if activity.anonymous_comment == 0%> 未开启匿评 <% end %> 作品提交中 <% elsif activity.homework_detail_manual.comment_status == 2%> <% if activity.anonymous_comment == 0%> 匿评中 <% end %> 教师教辅评阅中 <% elsif activity.homework_detail_manual.comment_status == 3%> <% if activity.anonymous_comment == 0%> 匿评已结束 <% end %> 教师教辅评阅中 <% end%> <% 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%> <% comment_status = activity.homework_detail_manual.comment_status %>
    • <%= link_to l(:button_edit),edit_homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity), :class => "postOptionLink"%>
    • <%= link_to(l(:label_bid_respond_delete), homework_common_path(activity,:is_in_course => -1,:course_activity=>course_activity),: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) %>
    • <% if activity.anonymous_comment == 0 %>
    • <%= 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 %> <% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
    • <%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id,:course_activity=>course_activity),:class => "postOptionLink", :remote => true)%>
    • <% end %>
<% 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%>