    <div class="show_hwork_arrow"></div>
    <div class="showHwork">
      <ul>
        <li class="fl" >
          <span class="tit_fb">上交时间：</span>
          <%=format_time work.created_at %>
        </li>

        <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
            <!-- 我的作业 && 匿评作业 && 未开启匿评，显示编辑和删除按钮 -->
            <li class="fr" >
              <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del")  %>
            </li>
            <li class="fr" >
              <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
            </li>
        <% end%>
        <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%>
            <!-- 匿评结束阶段，显示点赞按钮 -->
            <li class="fr" id="student_work_praise_<%= work.id%>">
              <%= render :partial => 'student_work_praise',:locals => {:work => work} %>
            </li>
        <% end%>
        <div class="cl"></div>

        <li >
          <span class="tit_fb ">编程代码：</span>
          <div class="showHworkP break_word"><pre id="work-src_<%= work.id%>" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
            </div>
          </div>
          <div class="cl"></div>
        </li>

        <li class="mt10 fl">
          <span class="tit_fb ">
            测试结果：
          </span>
          <div class="show_hwork_p break_word">
            <% work.student_work_tests.each_with_index do |test, index| %>
                <div class="ProResultTop">
                  <p class="c_blue fl">
                    第<%= work.student_work_tests.count - index%>次测试
                  </p>
                  <span class="fr c_grey">
                    <%= test.created_at.to_s(:db) %>
                  </span>
                  <div class="cl"></div>
                </div>
                <% if test.status.to_i == -2 %>
                    <div class="ProResultCon ">
                      <%= test.results.first %>
                    </div>
                <% else %>
                    <div class="ProResultTable " >
                      <ul class="ProResultUl " >

                        <% test.results.reverse.each_with_index do |x, i| %>
                          <% unless x.nil? %>
                            <li >
                              <span class="w60 T_C">测试<%=test.results.size-i%></span>
                              <% if x["status"].to_i != 0 %>
                                  <% if x["status"].to_i == 2 %>
                                      <span class="w60 c_red">超时！</span>
                                  <% else %>
                                      <span class="w60 c_red">测试错误！</span>
                                  <% end %>
                                  <span class="w60">您的输出：</span>
                                  <span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span>
                                  <span class="w60">正确输出：</span>

                                  <span  class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["output"].force_encoding("UTF-8")%></pre></span>
                                  <span class="w50">耗时：</span>
                                  <span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
                                  <div class="cl"></div>
                              <% else %>
                                  <span class="w60 c_green">测试正确！</span>
                                  <span style="width:360px;">&nbsp;</span>
                                   <span class="w50">耗时：</span>
                                   <span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
                                  <div class="cl"></div>
                              <% end %>
                            </li>
                          <% end %>
                        <% end %>
                      </ul>
                    </div>
                <% end %>
            <% end %>
          </div>
        </li>

        <li >
          <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
              <!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
              <div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
                <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
              </div>
          <% end%>
          <div class="cl"></div>
        </li>
      </ul>

      <div id="revise_attachment">
        <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
      </div>
      <div class="cl"></div>

      <div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
        <%student_work_scores.each do |student_score|%>
            <div id="work_score_<%= student_score.id%>">
              <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
            </div>
        <% end%>
      </div>
      <div class="cl"></div>
      <!---ping_box end--->
      <a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
      <div class="cl"></div>
    </div>
<script type="text/javascript">
    $(function(){
        <% if defined?(is_focus) && is_focus.to_i == 1 %>
        $("#upload_revise_attachment").click();
        <% end %>
    });
    function show_upload(){
        $("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
        showModal('ajax-modal', '452px');
        $('#ajax-modal').siblings().remove();
        $('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
        $('#ajax-modal').parent().css("top","40%").css("left","46%");
        $('#ajax-modal').parent().addClass("resourceUploadPopup");
        $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
    }
    function regex_des() {
        if ($.trim($("#attachment_des").val()) == "") {
            $("#hint_message").text("附件描述不能为空");
            $("#hint_message").css('color','#ff0000');
            return false;
        } else {
            $("#hint_message").text("");
            return true;
        }
    }
    function submit_revise_files(){
        if (regex_des()) {
            $("#upload_form").submit();
        }
    }
    function closeModal(){
        hideModal($(".uploadBoxContainer"));
    }
    function disable_choose(){
        if ($("#attachments_fields .attachment").size() >= 1) {
            $("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
        }
    }
</script>
