<div class="fl" style="padding-bottom:10px; width:720px;">
  <span class="c_dark f14 fb fl mr30">
      测验
      <font class="f12 c_red">
        (<%= @exercise_count%>人已交)
      </font>
    <% if !@is_teacher && @exercise_users_list.empty?%>
       <span class="f12 c_red">您尚未提交</span>
    <% elsif !@is_teacher && !@exercise_users_list.empty?%>
       <span class="f12 c_red">您已提交</span>
    <% end %>
  </span>
  <%#if @is_teacher || @exercise.exercise_status == 3%>
  <!--<div class="hworkSearchBox">
        <input type="text" id="course_student_name" value="<%#= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%#= student_work_index_path(:homework => @homework.id)%>',event);"/>
        <a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%#= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
      </div>-->
  <%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty?  %>
  <%# end%>
  <span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示测验信息 ]</a> </span>
</div>
<div class="cl"></div>

<div class="fl">
  <%= render :partial => "student_table"%>
</div>
<div class="cl"></div>

<% @exercise_users_list.each do |exercise|%>
    <script type="text/javascript">
        $(".student_work_<%= exercise.id%>").mouseenter(function(){
            $("#work_click_<%= exercise.id%>").show();
        }).mouseleave(function(){
            $("#work_click_<%= exercise.id%>").hide();
        });
        $(function(){
            <% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
            $("#show_student_result_div_<%= exercise.id%>").on('click',function() {
                window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
            });
            <% else %>
            $("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到，暂不能查看学生答题结果");
            $("#student_name_<%= exercise.id%>").attr("title","截止日期未到，暂不能查看学生答题结果");
            $("#student_id_<%= exercise.id%>").attr("title","截止日期未到，暂不能查看学生答题结果");
            $("#student_class_<%= exercise.id%>").attr("title","截止日期未到，暂不能查看学生答题结果");
            <% end %>
        });
        /*function show_result(id) {
         window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
         }*/
    </script>
    <ul class="hworkListRow" id="student_work_<%= exercise.id%>">
      <li class="ml5 mr5" style="width:28px; text-align:center;">1</li>
      <li class="hworkPortrait mt15 mr10">
        <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(exercise.user)) %>
      </li>
      <li class="hworkStName" title="姓名" id="student_name_<%= exercise.id%>" style="cursor:pointer;">
        <%=exercise.user.show_name %>
      </li><li class="hworkStID pl15 pr10" title="学号" id="student_id_<%= exercise.id%>" style="cursor:pointer;">
      <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
    </li>
      <li class="hworkStID" title="班级"  id="student_class_<%= exercise.id%>" style="cursor:pointer;">
        --
      </li>
      <li class="hworkList130 ml200 c_grey student_work_<%= exercise.id%>">
        <% if exercise.created_at%>
            <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
            <% if @exercise.end_time <= exercise.created_at %>
                <span class="c_red">[未答]</span>
            <% end %>
        <% end %>
      </li>

      <li class="hworkList50 <%= score_color exercise.score%> student_final_scor_info">
        <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
      </li>
      <li class="hworkTip" style="display: none" id="work_click_<%= exercise.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></li>
    </ul>

    <div class="cl"></div>
<% end%>