<% is_expand = st.student_work_projects.empty? %>
<ul id="syllabus_course_ul">
  <li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
    <div class="syllabus_class_w fontGrey3 student_work_<%= st.id%>" style="<%=!is_expand ? '' : 'cursor: pointer;' %>" <%= !is_expand ? '' : "onclick = "+"show_student_work('"+"#{student_work_path(st)}"+"')" %>>
      <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
      <% if !is_expand %>
          <span class="fl student_work_<%= st.id%>" style="width:105px;">
            <span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span>
            <span class="fl">(组长)</span>
          </span>
          <span class="fl hidden student_work_<%= st.id%>" style="width:90px; margin-right:3px;">
            <span class="fontGrey2">学号</span>：<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
          </span>
      <% else %>
          <span class="fl student_work_<%= st.id%>" style="width:105px;">
            <span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span>
          </span>
          <span class="fl student_work_<%= st.id%> hidden" style="width:90px; margin-right:3px;">
            <span class="fontGrey2">学号</span>：<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
          </span>
      <% end %>
      <div class="flex-container fl" style="width:376px;">
        <div class="flex-cell"><span class="<%= score_color st.teacher_score%> ml35"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
        <div class="flex-cell"><span class="<%= score_color st.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
        <% if @homework.anonymous_comment == 0 %>
            <div class="flex-cell">
              <div class="<%= score_color st.student_score%> student_score_info ml35 pr">
                <% if st.student_score.nil? %>
                    <span title="该作品未被匿评">未参与</span>
                <% else %>
                    <%= format("%.1f", st.student_score) %>
                <% end %>
                <% unless st.student_score.nil? %>
                        <span class="linkBlue">
                            (<%= anon_count %>)
                        </span>
                    <div class="g_infoNi none">
                      现共有
                      <span class="c_red">&nbsp;<%= anon_count %>&nbsp;</span>
                      名学生进行了匿评，平均分为
                      <span class="c_red">&nbsp;<%= format("%.1f", st.student_score) %>&nbsp;</span>分。
                    </div>
                <% end %>
              </div>
            </div>
        <% end %>
        <div class="flex-cell">
          <% score = st.work_score %>
          <div class="<%= score_color score%> student_final_scor_info ml35 pr" style="display: inline">
            <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
            <% unless score.nil?%>
                <div class="g_infoNi none width180" style="line-height: 18px;">
                  作品最终评分为
                  <span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分<br/>
                  迟交扣分
                      <span class="c_red">&nbsp;
                        <%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
                        &nbsp;</span>分<br/>
                  缺评扣分
                      <span class="c_red">&nbsp;
                        <%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
                        &nbsp;</span>分<br/>
                  最终成绩为
                  <span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分
                </div>
            <% end%>
          </div>
        </div>
      </div>
      <% if is_expand %>
          <div class="fr ml5" style="width:25px; color: #3b94d6; white-space:nowrap; text-align:right; margin-right:5px;" onclick = "show_student_work(<%= student_work_path(st)%>)">评分</div>
      <% end %>
    </div>
    <div class="hworkTip" style="display: none; left:700px; top:20px; white-space:nowrap; right:auto;" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击进行评分' %></font></div>
  </li>
</ul>

<script type="text/javascript">
    $(".student_work_<%= st.id%>").mouseenter(function(){
        if($("#about_hwork_<%= st.id%>").html().trim() == "") {
            $("#work_click_<%= st.id%>").show();
        }
    }).mouseleave(function(){
        $("#work_click_<%= st.id%>").hide();
    }).mouse;

    $(".syllabus_class_list").mouseenter(function(){
        $(this).css("background-color","#f6fafd");
    });
    $(".syllabus_class_list").mouseleave(function(){
        $(this).css("background-color","#fff");
    });
</script>