<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DoTest2.aspx.cs" Inherits="Tester_DoTest2" %>

<%@ Register assembly="System.Web.Extensions" namespace="System.Web.UI" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>考试进行中</title>
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
    .txtBlank
    {
            width:30px;
    }
     .divContent
        {
             overflow:auto;
              width:770px;
              margin:5px;
        }
     .txt
      {
            border-width:0;
            border-bottom:solid 1px black;
            color:Black;
      }  
    </style>
    <script type="text/javascript">
    function dispDiv(divID)
    {
        var e=document.getElementById(divID);
        if(e.style.display!="none")
            e.style.display="none";
         else
            e.style.display="";
    }
        function show()
        {
            var timeTip=document.getElementById("timeTip");
            if(timeTip.style.display=="none")
               timeTip.style.display="";
            else
                timeTip.style.display="none";
         }
        
        function document.onkeydown()    
        {    
            if ( (event.keyCode==116)||                  //屏蔽 F5 刷新键    
                (event.ctrlKey && event.keyCode==82))
                { //Ctrl + R    
                     event.keyCode=0;    
                     event.returnValue=false;    
                }    
        }    
     //各类题型的标题的显示处理   
    function dispTitle()
    {
            var e1=document.getElementById("lblFillBlankListCount");
            if(e1.innerText=="0")
                {
                    var e=document.getElementById("trFillBlank");
                    e.style.display="none";
                }
             
            var e2=document.getElementById("lblJudgeListCount");
            if(e2.innerText=="0")
                {
                    var e=document.getElementById("trJudge");
                    e.style.display="none";
                }
             
            var e3=document.getElementById("lblSingleSelectionCount");
            if(e3.innerText=="0")
                {
                    var e=document.getElementById("trSingleSelection");
                    e.style.display="none";
                }   
             
            var e4=document.getElementById("lblMultiSelectionCount");
            if(e4.innerText=="0")
                {
                    var e=document.getElementById("trMultiSelection");
                    e.style.display="none";
                }
                
           var e5=document.getElementById("lblSimpleAnswerCount");
            if(e5.innerText=="0")
                {
                    var e=document.getElementById("trSimpleAnswer");
                    e.style.display="none";
                }
      }   
           </script>
</head>
<body onload="dispTitle()">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
          <script type="text/javascript">
    
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
         
    function EndRequestHandler(sender, args)
    {
       if (args.get_error() != undefined)
        {
             if ((args.get_response().get_statusCode() == '12007') || (args.get_response().get_statusCode() == '12029'))
             {        
               alert('请检查您是否已经连接到Internet');
               window.onerror=true;
             }
        }
    }
    
    </script>                       
            <table cellpadding="0" cellspacing="0" class="form" width="800px">
                <tr>
                    <td class="formName" align="left">
                        <span style="margin-left:10px">
                        <asp:Label ID="lblTestName" runat="server" Text="考试名称"></asp:Label>
                        </span>
                    </td>
                </tr>
                <tr id="trFillBlank">
                    <td  class="titleName" style="text-align:left; font-weight:bold;" onclick="dispDiv('divSubjectOfFillBlankList')" title="点击展开或隐藏">
                        填空题(<asp:Label ID="lblFillBlankListCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:Label ID="lblFillBlankScores" runat="server" Text="0"></asp:Label>
                        分 共<asp:Label ID="lblFillBlankTotalScores" runat="server" Text="0"></asp:Label>
                        分</td>
                </tr>
                
                 <tr>
                    <td>
                     
                    <div id="divSubjectOfFillBlankList" style="text-align:left;">
                    
                          <asp:Repeater ID="rptSubjectOfFillBlankList" runat="server" 
                    >
                    <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                    </HeaderTemplate>
                <ItemTemplate>
                     <tr>
                        <td >
                            <asp:HiddenField ID="hidFillBlankID" runat="server"  Value='<%#Eval("ID") %>'/>
                            (<%#Eval("Index")%>) <%#Eval("Question")%> 
                            
                            </td>
                    </tr>     
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
               </asp:Repeater>
                        </div>
                        </td>
                </tr>
                 <tr id="trJudge">
                    <td class="titleName" style="text-align:left; font-weight:bold;" onclick="dispDiv('divSubjectOfJudgeList')" title="点击展开或隐藏">
                       判断题(<asp:Label ID="lblJudgeListCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:Label ID="lblJudgeScores" runat="server" Text="0"></asp:Label>
                        分 共<asp:Label ID="lblJudgeTotalScores" runat="server" Text="0"></asp:Label>
                        分</td>
                </tr>
                
                 <tr>
                    <td >
                      <div id="divSubjectOfJudgeList" style="text-align:left; ">
                      <div style="color:Red; text-align:left">提示：对填Y，错填N</div>
                          <asp:Repeater ID="rptSubjectOfJudgeList" runat="server" 
                    >
                    <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                    </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                            <asp:HiddenField ID="hidJudgeID" runat="server"  Value='<%#Eval("ID") %>'/>
                         (<%#Eval("Index")%>) <%#Eval("Question")%> (<asp:TextBox ID="txtJudgeAnswer" runat="server"  BorderWidth="0" Width="20px" ToolTip="对填Y，错填N" MaxLength="1"></asp:TextBox>)
                         </td>
                    </tr>     
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
               </asp:Repeater>
                        </div>
                    </td>
                </tr>
                  <tr id="trSingleSelection">
                    <td class="titleName" style="text-align:left; font-weight:bold;" onclick="dispDiv('divSubjectOfSingleSelectionList')" title="点击展开或隐藏">
                        单选题(<asp:Label ID="lblSingleSelectionCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:Label ID="lblSingleSelectionScores" runat="server" Text="0"></asp:Label>
                        分 共<asp:Label ID="lblSingleSelectionTotalScores" runat="server" Text="0"></asp:Label>
                        分</td>
                </tr>
                
                 <tr>
                    <td >
                    <div id="divSubjectOfSingleSelectionList" style="text-align:left;">
                      <div style="color:Red; text-align:left">提示：不区分大小写字母</div>
                     <asp:Repeater ID="rptSubjectOfSingleSelectionList" runat="server" 
                   >
               <HeaderTemplate>
                     <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                        <asp:HiddenField ID="hidSingleSelectionID" runat="server" Value='<%#Eval("ID") %>'></asp:HiddenField>
                        <b>
                         (<%#Eval("Index")%>)  <%#Eval("Question") %> (<asp:TextBox ID="txtSingleSelectionAnswer" runat="server" BorderWidth="0"  Width="20px"  MaxLength="1"></asp:TextBox>)
                         </b><br />
                           <table width="100%" class="tableList2">
                           <tr align="left"><td style="width:50%">A:<%#Eval("SelectA")%></td><td>B:<%#Eval("SelectB")%></td></tr>
                            <tr align="left"><td style="width:50%">C:<%#Eval("SelectC")%></td><td>D:<%#Eval("SelectD")%></td></tr>
                           </table>
                            </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                     </table>
                </FooterTemplate>
               </asp:Repeater>
                    </div>
                   </td>
                </tr>
                  <tr id="trMultiSelection">
                    <td class="titleName" style="text-align:left; font-weight:bold;" onclick="dispDiv('divSubjectOfMultiSelectionList')" title="点击展开或隐藏">
                        多选题(<asp:Label ID="lblMultiSelectionCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:Label ID="lblMultiSelectionScores" runat="server" Text="0"></asp:Label>
                        分 共<asp:Label ID="lblMultiSelectionTotalScores" runat="server" Text="0"></asp:Label>
                        分</td>
                </tr>
                
                 <tr>
                    <td >
                      <div id="divSubjectOfMultiSelectionList" style="text-align:left">
                      <div style="color:Red; text-align:left">提示：不区分大小写字母</div>
                     <asp:Repeater ID="rptSubjectOfMultiSelectionList" runat="server" 
                   >
               <HeaderTemplate>
                     <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                        <asp:HiddenField ID="hidMultiSelectionID" runat="server" Value='<%#Eval("ID") %>'></asp:HiddenField>
                        <b>
                         (<%#Eval("Index")%>)  <%#Eval("Question")%> (<asp:TextBox ID="txtMultiSelectionAnswer" runat="server" BorderWidth="0"  Width="35px"  MaxLength="4"></asp:TextBox>)
                         </b><br />
                           <table width="100%" class="tableList2">
                           <tr align="left"><td style="width:50%">A:<%#Eval("SelectA")%></td><td>B:<%#Eval("SelectB")%></td></tr>
                            <tr align="left"><td style="width:50%">C:<%#Eval("SelectC")%></td><td>D:<%#Eval("SelectD")%></td></tr>
                           </table>
                            </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                     </table>
                </FooterTemplate>
               </asp:Repeater>
                    </div>
                    </td>
                </tr>
                  <tr id="trSimpleAnswer">
                    <td class="titleName" style="text-align:left; font-weight:bold;" onclick="dispDiv('divSubjectOfSimpleAnswerList')" title="点击展开或隐藏">
                       简答题(<asp:Label ID="lblSimpleAnswerCount" runat="server" Text="0"></asp:Label>)&nbsp; 
                        共<asp:Label ID="lblSimpleAnswerTotalScores" runat="server" Text="0"></asp:Label>
                        分</td>
                </tr>
                
                 <tr>
                    <td >
                     <div id="divSubjectOfSimpleAnswerList" style="text-align:left">
                    <asp:Repeater ID="rptSubjectOfSimpleAnswerList" runat="server" 
                    >
                <HeaderTemplate>
                     <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                        <asp:HiddenField ID="hidSimpleAnswerID" runat="server" Value='<%#Eval("ID") %>'></asp:HiddenField>
                        <div style="width:20px;  float:left; margin:0;margin-top:5px;">(<%#Eval("Index")%>)</div>
                        <div class="divContent">
                          <%#Eval("Question")%>(<%#Eval("Scores")%>分)
                            </div>
                            <asp:TextBox ID="txtSimpleAnswerAnswer" runat="server" TextMode="MultiLine" Width="800px" Height="100px"  CssClass="txt" BorderStyle="Solid" BorderWidth="1px" BorderColor="Black"  Text="填写答案"></asp:TextBox>
                            </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                     </table>
                </FooterTemplate>
               </asp:Repeater>
                      </div>
                  
                   </td>
                </tr>
                <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                       其他信息
                    </td>
                </tr>
                
                 <tr>
                    <td>
                                        <asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
            <ContentTemplate>  
                                  
                        <asp:Label ID="lblMsg" runat="server" Text="" ForeColor="Red"></asp:Label>
                            <div ID="timeTip" class="tip" style="width: 500px;">
                            <span class="content">提示： 考试时长（<asp:Label ID="lblNeededMinutes" runat="server" 
                                Text="0"></asp:Label>
                            分钟） 剩余时间（<asp:Label ID="lblTimeLeft" runat="server" Text="0小时0分钟0秒"></asp:Label>
                            ）</span></div>
                        <div class="tip" style="width:500px">
                            <span class="content">提示：考试期间请勿关闭窗口、刷新页面！(系统每隔<span style="color: gray"><asp:Label 
                                ID="lblAutoSaveMinutes" runat="server" Text="0"></asp:Label>
                            分钟</span>自动保存一次答案 )</span></div>
                              </ContentTemplate>
            <Triggers> <asp:AsyncPostBackTrigger ControlID="btnSaveAnswer" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="Timer2" EventName="Tick" />
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                                            </Triggers>
    </asp:UpdatePanel>
                    </td>
                </tr>
                <tr>
                    <td  class="submitArea">
     <b style="color:White;">
                         该试卷共<asp:Label ID="lblTotalScores" runat="server" Text="0"></asp:Label>
                         分</b>
                             <asp:Button ID="btnSaveAnswer" runat="server" Text="保存答案"  CssClass="btn" 
                             Width="80px" onclick="btnSaveAnswer_Click" />  
    <asp:Button ID="btnSubmit" runat="server" CssClass="btn" 
                            onclick="btnSubmit_Click " OnClientClick="return confirm('确定交卷吗？')" Text="交  卷" 
                            Width="80px" />
                            </td>
                </tr>
            </table>

    <script type="text/javascript">
     //隐藏
    dispDiv("divSubjectOfFillBlankList");
    dispDiv("divSubjectOfJudgeList");
    dispDiv("divSubjectOfSingleSelectionList");
    dispDiv("divSubjectOfMultiSelectionList");
    dispDiv("divSubjectOfSimpleAnswerList");
    </script>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick" 
        Enabled="False">
        </asp:Timer>
                <asp:Timer ID="Timer2" runat="server" OnTick="Timer2_Tick" 
        Interval="300000" Enabled="False">
        </asp:Timer>
            </form>
</body>
</html>
