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

<!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;
      }  
       .txt2
      {
            border-width:0;
      }
    </style>
    <script type="text/javascript">
    //计算1、2、3、4类题目的总分数
    function setTotalScores(obj,lblCountID,lblTotalScoresID)
    {
       var e=document.getElementById(obj.id);
       document.getElementById(lblTotalScoresID).value=e.value * document.getElementById(lblCountID).innerText;
       
       getTotalScores()
    }
    
    //计算简答题的总分数
    function setTotalScoresForSimpleAnswer()
    {
        var e=document.getElementById('lblSimpleAnswerCount');
        var count=Number(e.innerText);
        var totalScores=0;
        for(var i=0; i<count; i++)
        {
            var str1="rptSubjectOfSimpleAnswerList_ctl";
            if(i<9)
                str1=str1+"0";
            var id=str1+(i+1)+"_txtSimpleAnswerScores"
            var scores=document.getElementById(id).value;
            if(scores=="" || null==scores)
                scores=0;
            totalScores+=Number(scores);
        }
        
        document.getElementById("lblSimpleAnswerTotalScores").innerText=totalScores;
        
        getTotalScores()
    }
    
    function getTotalScores()
    {
        var n1=document.getElementById("lblFillBlankTotalScores").value;
        var n2=document.getElementById("lblJudgeTotalScores").value;
        var n3=document.getElementById("lblSingleSelectionTotalScores").value;
        var n4=document.getElementById("lblMultiSelectionTotalScores").value;
        var n5=document.getElementById("lblSimpleAnswerTotalScores").innerText;
        var sum=Number(n1)+Number(n2)+Number(n3)+Number(n4)+Number(n5);

        document.getElementById("txtTotalScores").value=sum;
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
      <div class="listAddLink"><a href="javascript:history.go(-1)">返回</a></div>
            <table cellpadding="0" cellspacing="0" class="form" width="800px">
                <tr>
                    <td class="formName" align="left">
                        <span style="margin-left:10px">分配分数</span>
                    </td>
                </tr>
                <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                        1、填空题(<asp:Label ID="lblFillBlankListCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:TextBox ID="txtFillBlankScores" runat="server" Width="20px" CssClass="txt" onkeyup="setTotalScores(this, 'lblFillBlankListCount', 'lblFillBlankTotalScores')"></asp:TextBox>
                        分，总共<asp:TextBox ID="lblFillBlankTotalScores" runat="server" Width="20px" CssClass="txt2"  ToolTip="修改无效" Text="0"></asp:TextBox>
                        分
                        </td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                    <div style="text-align:left;">
                          <asp:Repeater ID="rptSubjectOfFillBlankList" runat="server" 
                    >
                    <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                    </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                            (<%#Eval("Index")%>) <%#Eval("Question")%> <span style="color:Red"> 答案：<%# Eval("Answer")%></span></td>
                    </tr>     
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
               </asp:Repeater>
                <asp:Label ID="Label1" runat="server" Text="暂无试题！"></asp:Label>
                        </div>
                   
                        </td>
                </tr>
                 <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                       2、判断题(<asp:Label ID="lblJudgeListCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:TextBox ID="txtJudgeScores" runat="server" CssClass="txt" Width="20px" onkeyup="setTotalScores(this, 'lblJudgeListCount', 'lblJudgeTotalScores') "></asp:TextBox>
                        分，总共<asp:TextBox ID="lblJudgeTotalScores" runat="server" Width="20px" CssClass="txt2"  ToolTip="修改无效" Text="0"></asp:TextBox>
                        分</td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                      <div style="text-align:left;">
                          <asp:Repeater ID="rptSubjectOfJudgeList" runat="server" 
                    >
                    <HeaderTemplate>
                    <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                    </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                         (<%#Eval("Index")%>) <%#Eval("Question")%> (<span style="color:Red"><%#(bool)Eval("Answer") ? "Y" : "N"%></span>)
                         </td>
                    </tr>     
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
               </asp:Repeater>
                <asp:Label ID="Label2" runat="server" Text="暂无试题！"></asp:Label>
                        </div>
                    </td>
                </tr>
                  <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                        3、单选题(<asp:Label ID="lblSingleSelectionCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:TextBox ID="txtSingleSelectionScores" runat="server" CssClass="txt" Width="20px" onkeyup="setTotalScores(this, 'lblSingleSelectionCount', 'lblSingleSelectionTotalScores')"></asp:TextBox>
                        分，总共<asp:TextBox ID="lblSingleSelectionTotalScores" runat="server" Width="20px" CssClass="txt2"  ToolTip="修改无效" Text="0"></asp:TextBox>
                        分</td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                    <div style="text-align:left">
                     <asp:Repeater ID="rptSubjectOfSingleSelectionList" runat="server" 
                   >
               <HeaderTemplate>
                     <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                        <b>
                         (<%#Eval("Index")%>)  <%#Eval("Question") %> (<span style="color:Red;"><%# Eval("Answer")%></span>)
                         </b><br />
                           <table width="100%">
                           <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>
                        <asp:Label ID="Label3" runat="server" Text="暂无试题！"></asp:Label>
                    </div>
                   </td>
                </tr>
                  <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                        4、多选题(<asp:Label ID="lblMultiSelectionCount" runat="server" Text="0"></asp:Label>)
                        每题<asp:TextBox ID="txtMultiSelectionScores" runat="server" CssClass="txt" Width="20px" onkeyup="setTotalScores(this, 'lblMultiSelectionCount', 'lblMultiSelectionTotalScores')"></asp:TextBox>
                        分，总共<asp:TextBox ID="lblMultiSelectionTotalScores" runat="server" Width="20px" CssClass="txt2"  ToolTip="修改无效" Text="0"></asp:TextBox>
                        分</td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                      <div style="text-align:left">
                     <asp:Repeater ID="rptSubjectOfMultiSelectionList" runat="server" 
                   >
               <HeaderTemplate>
                     <table cellpadding="0" cellspacing="0" class="tableList" width="800">
                </HeaderTemplate>
                <ItemTemplate>
                     <tr >
                        <td >
                        <b>
                         (<%#Eval("Index")%>)  <%#Eval("Question")%> (<span style="color:Red;"><%# Eval("Answer")%></span>)
                         </b><br />
                           <table width="100%">
                           <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>
                        <asp:Label ID="Label4" runat="server" Text="暂无试题！"></asp:Label>
                    </div>
                    </td>
                </tr>
                  <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                        5、简答题(<asp:Label ID="lblSimpleAnswerCount" runat="server" Text="0"></asp:Label>) 
                        总共<asp:Label ID="lblSimpleAnswerTotalScores" runat="server" Text="0"></asp:Label>
                        分
                    </td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                    <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") %>'/>
                        <div style="width:20px;  float:left; margin:0;margin-top:5px;">(<%#Eval("Index")%>)</div> 该题<asp:TextBox ID="txtSimpleAnswerScores" runat="server" CssClass="txt" Width="20px" onkeyup="setTotalScoresForSimpleAnswer()"></asp:TextBox>
                        分
                        <div class="divContent">
                          <%#Eval("Question")%>
                            </div>
                           <%-- <div class="divContent" style="color:Red">
                            答题：<%# Eval("Answer")%>
                            </div>--%>
                            </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                     </table>
                </FooterTemplate>
               </asp:Repeater>
                      <asp:Label ID="Label5" runat="server" Text="暂无试题！"></asp:Label>
                   </td>
                </tr>
                <tr>
                    <td class="titleName" style="text-align:left; font-weight:bold;">
                       其他信息
                    </td>
                </tr>
                
                 <tr>
                    <td class="inputArea">
                    试卷名称：<span style="color:Black"><asp:Label ID="lblPaperName" runat="server" Text=""></asp:Label></span>&nbsp;
                    试卷所属部门：<span style="color:Black"><asp:Label ID="lblPaperType" runat="server" Text=""></asp:Label></span>
                       </td>
                </tr>
                <tr>
                    <td  class="submitArea">
                        <span  style="color:White;  font-weight:bold;">
                         共<asp:TextBox ID="txtTotalScores" runat="server" Width="20px" CssClass="txt2"  ToolTip="修改无效" Text="0"></asp:TextBox>
                         分</span>
                         &nbsp; 
                         <asp:Button ID="btnSave" runat="server" CssClass="btn" Text="下一步"  ToolTip="添加考试"
                             Width="80px" onclick="btnSave_Click" />
                         <span style="margin-right:10px">
                         &nbsp;</span></td>
                </tr>
            </table>
            <div class="tip" style="width:800px"><span class="content">说明：1-4只分配每题多少分，5要对每一题分配分数</span></div>
              
    </form>
</body>
</html>
