<!-- 匿评作品列表，显示某一个作品的信息 -->
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
  <li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
    <ul>
      <li class="hworkPortrait mt15 mr10">
        <%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
      </li>
      <div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
        <li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
          <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
          <div>
            <%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
          </div>
        </li>
        <li>
          <ul class="mt10 fl">
            <li class="hworkStName mr10 mt16" title="姓名">
              <%= student_work.user.show_name%>
            </li>
            <li class="hworkStID mt16" title="学号">
              <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
            </li>
          </ul>
        </li>
      </div>
    </ul>
  </li>
  <li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
    <% if student_work.created_at && @homework.end_time%>
        <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
        <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
            <span class="c_red">[迟交]</span>
        <% end %>
    <% end %>
  </li>
  <li class="hworkList50 <%= score_color student_work.teacher_score%>">
    <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
  </li>
  <li class="hworkList50 <%= score_color student_work.teaching_asistant_score%>">
    <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
  </li>

  <% if @homework.homework_type == 2%>
      <!-- 系统评分 -->
      <li class="hworkList50 <%= score_color student_work.system_score%>">
        <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
      </li>
  <% end%>

  <li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
    <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
    <% unless student_work.student_score.nil?%>
        <span class="linkBlue">
          (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
        </span>
        <div class="infoNi none">
          现共有
          <span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>&nbsp;</span>
          名学生进行了匿评，平均分为
          <span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。
        </div>
    <% end%>
  </li>

  <!-- 成绩 -->
  <% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
  <li class="hworkList50 <%= score_color score%> student_final_scor_info">
    <%= score.nil? ? "--" : format("%.1f",score)%>
    <% unless score.nil?%>
        <div class="infoNi none width180">
          作品最终评分为
          <span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
          迟交扣分
          <span class="c_red">&nbsp;<%= student_work.late_penalty%>&nbsp;</span>分，
          缺评扣分
          <span class="c_red">&nbsp;<%= student_work.absence_penalty%>&nbsp;</span>分，
          最终成绩为
          <span class="c_red">&nbsp;<%= format("%.1f",score)%>&nbsp;</span>分。
        </div>
    <% end%>
  </li>
</ul>

