<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebExam.Admin.Exam.Admin_SJ" Title="试卷管理" Codebehind="KS.SJ.aspx.cs" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.HtmlTags" %>


<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
    <asp:Panel ID="ListPanel" runat="server" Width="100%">
	<script>
        function GetMyIds() {
            var sid = null;
            for (var i = 0; i < document.getElementsByName("ids").length; i++) {
                var KS = document.getElementsByName("ids")[i];
                if (KS.checked == true) {
                    if (sid == null)
                        sid = KS.value;
                    else
                        sid += "," + KS.value;
                }
            }
            return sid;
        } 
        function ContentSetAttribute(){
            var sid = GetMyIds();
            if (sid!=null)  parent.openWin("批量设置试卷属性","<%=KSCMS.GetInstallDir()+MyCache.GetCacheConfig(4)%>/exam/KS.SJBatch.aspx?ContentID="+sid+"",true);
        }

    </script>
   	<div class="listedit">
         <ul>
         	<input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/><label for="chkall">全选</label>
            <asp:Button ID="BtnRecommend1" runat="server" CssClass="button" Text="取消推荐" onclick="BtnRecommend1_Click" OnClientClick="return(GetIDS());"/>
            <asp:Button ID="BtnRecommend2" runat="server" CssClass="button" Text="取消热门" onclick="BtnRecommend2_Click" OnClientClick="return(GetIDS());"/>
            <asp:LinkButton ID="editclassbutton" runat="server" OnClick="editclassbutton_Click" CssClass="button">编辑试卷</asp:LinkButton>
            <asp:LinkButton ID="delclassbutton" runat="server" OnClick="delclassbutton_Click" CssClass="button">删除试卷</asp:LinkButton>
            <asp:LinkButton ID="batchset" runat="server" CssClass="button">批量设置</asp:LinkButton>
         </ul>        
   	</div>  
        
	<style>
        .categorynav{line-height:25px;width:97%;margin:0 auto;margin-bottom:10px;border:1px solid #DEEFFA;background-color:#F7FBFE;padding:5px 0px 5px 10px; height:100%; overflow:hidden;}
        ul,li{padding:0px;margin:0px}
        .categorynav li{width:160px;float:left;}
    </style>
	<div class="content-area mt20">
        <div class="myTitle">
        	<div class="fr headOperation">
            	<ul>
                	<li class="fl"><asp:Button ID="BtnRecommend" runat="server" Text="设为推荐" CssClass="button" onclick="BtnRecommend_Click"  OnClientClick="return(GetIDS());"/></li>
                    <li class="fl"><asp:Button ID="BtnRecommend0" runat="server" CssClass="button" Text="设为热门" onclick="BtnRecommend0_Click"  OnClientClick="return(GetIDS());"/></li>
                	<li class="fl" id='p2'><a href="?action=add&fromword=1" class="button">从Word导入试卷</a></li>
                    <li class="fl" id='Li1'><asp:LinkButton ID="updatebutton" runat="server" OnClick="updatebutton_Click" CssClass="button">一键更新题目数</asp:LinkButton></li>
                </ul>
            </div>
            试卷管理
        	<!--<asp:Label ID="LabNav" runat="server"></asp:Label>-->
        </div>
       

        <div class="quickSearch clearfix">
            <div class="quickSelect">
                <asp:DropDownList ID="DrpClassID1" runat="server" onchange="location.href='?classid='+this.value;" Width="130">
                 <asp:ListItem Value="0">--按分类查看--</asp:ListItem>
                 </asp:DropDownList>
            </div>
            <div class="SearchBox fl">
                <asp:DropDownList ID="DrpTJ" runat="server" Style="margin-right:8px;">
                 <asp:ListItem Value="1">试卷名称</asp:ListItem>
                 <asp:ListItem Value="2">试卷介绍</asp:ListItem>
                 <asp:ListItem Value="3">试卷录入员</asp:ListItem>
                 <asp:ListItem Value="4">试卷ID</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox runat="server" ID="TxtKeyWord" CssClass="textbox" /> 
                <asp:Button ID="BtnSearch" runat="server" CssClass="button" Text="开始搜索" onclick="BtnSearch_Click"  />
            </div>
            <div class="property">
                <div class="name button ml15">筛选</div>
                <div class="propertyBox">
                    <ul class="tabs clearfix">
                        <span class="screen fl">试卷类型：</span>
                        <li <%=KSCMS.S("showType")==""?" class='active'":string.Empty %>><a href="KS.SJ.Aspx"><span>所有试卷</span></a></li>
                        <li <%=KSCMS.S("showType")=="10"?" class='active'":string.Empty %>><a href="KS.SJ.Aspx?showType=10">正规试卷</a></li>
                        <li <%=KSCMS.S("showType")=="1"?" class='active'":string.Empty %>><a href="KS.SJ.Aspx?showType=1"><span>模拟试卷</span></a></li>
                        <li <%=KSCMS.S("showType")=="3"?" class='active'":string.Empty %>><a href="KS.SJ.Aspx?showType=3"><span>手工组卷</span></a></li>
                        <li <%=KSCMS.S("showType")=="2"?" class='active'":string.Empty %>><a href="KS.SJ.Aspx?showType=2"><span>前台随机</span></a></li>
                        <li <%=KSCMS.S("showType")=="100"?" class='active'":string.Empty %>><a href="KS.SJ.Aspx?showType=100"><span>开考时间限制</span></a></li>
                    </ul>
                </div>
            </div>
            <div onmouseover="jQuery('#topcd').show();" onmouseout="jQuery('#topcd').hide();" class="fr liwrap">
               <li id='p1'class="button button_on">添加试卷</li>
               <div id="topcd" class="topcd" style="display:none">
                  <asp:LinkButton ID="addclassbutton" runat="server" OnClick="addclassbutton_Click">添加试卷</asp:LinkButton>
                  <a href="KS.SJXTZJ.aspx">手工组卷</a>
                  <a href="KS.sj.aspx?realtest=1">正规试卷</a>
               </div>
           </div>
        </div>  
		<KS:ksgv id="list" cssclass="CTable" runat="server" AutoGenerateColumns="False" 
            EmptyDataText="没有添加任何试卷!" PagerType="CustomNumeric" Width="99%" 
             GridLines="None" OnRowCommand="List_RowCommand" 
            OnRowCreated="List_RowCreated" onrowdatabound="list_RowDataBound">
        <Columns>
         <asp:TemplateField HeaderText="选择">
         
                <itemstyle horizontalalign="Center" Height="30px" width="30px" />
                <itemtemplate>
                <input type="checkbox"  name="ids" id="ids" value="<%#Eval("id") %>" />
                </itemtemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="ID号" DataField="ID" Visible="false">
                <itemstyle horizontalalign="Center" />
            </asp:BoundField>
             

            <asp:TemplateField >
               <HeaderStyle  HorizontalAlign="Left"  />
		<HeaderTemplate>模拟试卷名称</HeaderTemplate>
               <itemstyle width="500px" HorizontalAlign="Left"/>
                <itemtemplate>
                <div onmouseover="jQuery('#a<%#Eval("id") %>').show();" onmouseout="jQuery('#a<%#Eval("id") %>').hide();" class="examTitBox">

                	[<%# MyCache.GetCacheSJCategory(Convert.ToInt32(Eval("classid")),1) %>]
                	<a href="<%# Kesion.HtmlTags.BasicField.GetRewriteUrl("examview",Convert.ToInt32(Eval("id").ToString())) %>"   target="_blank">
						<%# Utils.CutStr(Convert.ToString(Eval("title")),60) %>
                        <%# Utils.StrToInt( Eval("realtest").ToString())==1 ?"<font color=red>正规</font>":string.Empty %>  
                    </a>
                  
                  <span>
						<%#Convert.ToString(Eval("recommend"))=="1"?"<font class='bg1'>荐</font>":"" %>
                        <%#Convert.ToString(Eval("popular"))=="1"?"<font class='bg2'>热</font>":"" %>
                        <%#Convert.ToString(Eval("istop"))=="1"?"<font class='bg3'>顶</font>":"" %>
                        <%#Convert.ToString(Eval("comment"))=="1"?"<font class='bg4'>评</font>":"" %>
                        <%#Convert.ToString(Eval("istjda")) == "1" ? "<font class='bg5'>案</font>" : ""%>
                  </span>
                  <span id='a<%#Eval("id") %>' style="display:none;padding-left:20px;">
                    <span style="display:<%#Eval("dtfs").ToString()=="2"? "none":"inline"%>;">
                     <asp:LinkButton runat="server" ForeColor="Gray" id="linkSTGL" commandargument=<%#Eval("id")+","+Eval("dtfs") %> commandname="stmanage">试题管理</asp:LinkButton>
                     <asp:LinkButton runat="server" ForeColor="Gray" ToolTip="添加试题" id="linkTJST" commandargument=<%#Eval("id")+","+Eval("dtfs") %> commandname="stadd"><img src="../../admin/images/ico/ico1.png" width="12" align="absmiddle" border="0"/>添加</asp:LinkButton>
                     </span>
                     <span class="grayFont" style="display:<%#Eval("dtfs").ToString()=="2"? "":"none"%>;">
                      随机抽<%# Eval("FrontSize") %>题
                     </span>
                  </span>
                  
                 </div>
                   
                </itemtemplate>

            </asp:TemplateField>
            <asp:TemplateField HeaderText="类型">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <%# GetSJDtfs(Convert.ToInt32(Eval("dtfs"))) %>
                </itemtemplate>
            </asp:TemplateField>
                    
           	<asp:TemplateField HeaderText="上传者">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <%#Eval("inputer") %>
                </itemtemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="试题总数">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <%# Convert.ToInt32(Eval("FrontSize")) %>
                </itemtemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="总分">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <%# Convert.ToInt32(Eval("Score")) %>
                </itemtemplate>
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText="考试时长">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <%# Convert.ToInt32(Eval("kssj")) %>分
                </itemtemplate>
            </asp:TemplateField>
            
            <asp:BoundField HeaderText="更新时间" DataField="adddate">
                <itemstyle verticalalign="Middle"  horizontalalign="Center"/>
            </asp:BoundField>
            <asp:TemplateField HeaderText="状态">
                <itemstyle Width="80px" horizontalalign="Center" />
                <itemtemplate>
                  <a href="?action=verify&id=<%#Eval("id")%>" <%# Convert.ToString(Eval("verify"))=="0"?"class='redFont' title='未审核'":"class='greenFont' title='已审核'" %>><%# Convert.ToString(Eval("verify"))=="0"?"未审核":"已审核" %></a>
                </itemtemplate>
            </asp:TemplateField>
            
              <asp:TemplateField HeaderText="考试人数">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <a href="KS.SJScore.aspx?sjid=<%# Eval("id")%>" class="link-color">  <%#Convert.ToString(Eval("TestHits"))%></a>
                </itemtemplate>
            </asp:TemplateField>
              <asp:TemplateField HeaderText="考试心得">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                <a href="KS.SJReviews.aspx?sjid=<%# Eval("id")%>" class="link-color">  <%# getrw(Utils.StrToInt((Eval("id").ToString())))%></a>
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作">
                <itemstyle horizontalalign="Center"/>
                <itemtemplate>
                <div class="operatBoxBtn">
                    <a class="button" style="border:none; background:none;"><i class="iMore"></i></a>
                    <div class="operatBoxMore clearfix">
                    	<a href="KS.SJScore.aspx?sjid=<%# Convert.ToInt32(Eval("id")) %>">查看</a>
                        <asp:LinkButton ID="LinkButton1" ToolTip="编辑" runat="server" commandargument=<%#Eval("id") %> commandname="modify">编辑</asp:LinkButton>
                        <asp:LinkButton ToolTip="删除" runat="server" id="delete" commandargument=<%#Eval("id") %> commandname="del">删除</asp:LinkButton>
                    	 <a href="?action=export&id=<%#Eval("id")%>&name=<%#Utils.CutStr(Convert.ToString(Eval("title")),60) %>&type=<%# Utils.StrToInt( Eval("dtfs")) %>" >导出</a>
                    </div>
                </div>
                
                </itemtemplate>
            </asp:TemplateField>


           
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    	</KS:ksgv>
    
            
 <KS:Page ID="Page1" runat="server" />
    <asp:Panel ID="Panel1" runat="server" Height="30px" Width="100%">
        <script type="text/javascript">
            showtips('<span class="state"><strong>试卷属性对应说明：</strong><br /></span><br/><font color=green>荐</font>->推荐&nbsp;<font color=red>热</font>->热门&nbsp;<font color=brown>顶</font>->固顶&nbsp;<font color=blue>评</font>->允许评论&nbsp;<font color=#789789>案</font>->允许立即提交看答案');
        </script>
    </asp:Panel>
</asp:Panel>
</div>
 <asp:Panel ID="AddPanel" runat="server"  Width="100%" Visible="false">
    <!--<KS:TopNav ID="TopNav1" runat="server" Text="添加模拟试卷" />-->
<div class="content-area mt20">    
    <script src="../../ks_inc/weiboApi.js"></script>
    <div class="tab-page" id="sjPanel">
         <script type="text/javascript">
             var tabPane1 = new WebFXTabPane( document.getElementById( "sjPanel" ), 1 )
         </script>
             
		 <div class="tab-page" id="tab0">
		  <h2 class="tab">基本信息</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage( document.getElementById( "tab0" ) );
			</script>
    
    <table width="100%"border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable"> 
      <tbody class="fromWordFile" id="inprotClass"<%=KSCMS.S("fromword")=="1"?"":" style='display:none'" %>>
       <tr class="CTitle">
           <td colspan="2" style="text-align:left"><strong>第一步：上传Word试题</strong></td>
       </tr>
       <tr>
            <td align="right" class="lefttd" height="30" ><strong>从Word文件导入：</strong>
            </td>
            <td class="righttd"><table border="0" cellpadding="0" cellspacing="0">
                 <tr>
                  <td style="padding-left:2px">
                      <!--
                      <iframe src="../include/UpLoad.aspx?FieldID=doc&ChannelID=1"  marginheight="0" marginwidth="0"  width="100%" height="32" frameborder="0" scrolling="no"></iframe>
                       -->
                      请将制作好的word试卷内容复制到以下编辑器，然后点击“清除格式”后再执行导入操作。
                  </td>
                  <td><a href="../../admin/exam/word试卷示例.doc" style="color:green">下载Word试卷示例</a></td>
                  <td> &nbsp;&nbsp;<asp:CheckBox ID="ChkIspublic" Text="题目共享（教师可搜索到此题目）" runat="server" /></td>
                 </tr>
                </table>
                <input type="text" style="display:inline;position:absolute; left:-9999px;" id="doc" value="0"  />
            </td>
        </tr>
        
        <tr id="sjtm">
            <td align="right" class="lefttd" height="30" >
                <strong>试卷的试题内容：</strong><br />
               <input type="button" class="button" value="存Word图片" onclick="KesionJS.saveWordPic('admin', '1');" />
                </td>
            <td class="righttd">
             <asp:TextBox ID="TxtContent" runat="server" TextMode="MultiLine" style="width:98%;height:400px;"></asp:TextBox>
            <% Kesion.APPCode.EditorAPI.EchoEditor("editor1", this.TxtContent.ClientID, "Common",0,false,true,false,false,true);%>

            </td>
        </tr>

        <script>
            function removeHTMLTag(str) {
                str = str.replace(/<\/?[^>]*>/g,''); //去除HTML tag
                str = str.replace(/[ | ]*\n/g,'\n'); //去除行尾空白
                str=str.replace(/&nbsp;/ig,'');//去掉&nbsp;
                return str;
            }
            jQuery(function(){
                var ie = !-[1,];  
                var evs="focus";
                if (ie) evs="propertychange";

                jQuery('#inprotClass,#doc').bind(evs, function(){
                    var path = jQuery("#doc").val();
                    if(path == 0)
                    {
                        return;
                    }
                    jQuery.ajax({
                        type: "POST",
                        url: "InportFromWord.ashx",
                        data: "path="+path,
                        success: function(s){
                            if(s.substring(0,3) == "err" && s.indexOf("找不到此文件")==-1)
                            {
                                jQuery.dialog.alert(s);
                                return;
                            }else{
                                var arr=s.split('[PaperNameEnd]');
                                jQuery("#sjtm").show();
                                jQuery("#sjdetail").show();
                                jQuery("#<%=this.TxtTitle.ClientID %>").val(removeHTMLTag(arr[0]));
                               editor1.setContent(arr[1]);
                           }
                        }
                    });
                });

        });
        </script>
      <tr class="CTitle">
           <td colspan="2" style="text-align:left"><strong>第二步：录入试卷基本信息</strong></td>
       </tr>
        </tbody>

        <tbody id="sjdetail"<%=KSCMS.S("fromword")=="1"?" style='display:nones'":"" %>>
          <tr>
            <td class="lefttd" height="30" align="right" style="width: 258px"><font color="red">*</font>试卷名称：</td>
            <td class="righttd">
                &nbsp;<asp:TextBox CssClass="textbox" ID="TxtTitle" runat="server" Width="325px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtTitle"
                    ErrorMessage="请填写试卷名称!" Display="Dynamic"></asp:RequiredFieldValidator><span class="tips">如（<%=DateTime.Now.Year.ToString() %>年仿真高考数学卷）等</span>
                   
                    </td>
        </tr>
  <script>
      function getKS(v) {
          jQuery.ajax({
              url: "KS.SJ.aspx?action=select&typeclassId=<%=thesjtypeclassId %>&theclassid=" + v, success: function (d) {
                  jQuery("#<%=this.drpSJtypeClass.ClientID %>").empty();
                  jQuery("#<%=this.drpSJtypeClass.ClientID %>").append(d);
              }
          });

          //addTM();
      }
          
      jQuery(document).ready(function () {
          <%if (thesjtypeclassId != 0){%>
          getKS(<%=theclassId %>); 
          <%} %>
          <%if (SJKnowledgeId != 0){%>
          getSJKnowledge(<%=thesjtypeclassId %>); 
          <%} %>
          realtest();
      });
     
      function getSJKnowledge(v) {
          var SJclassId = jQuery("#<%=this.DrpClassID.ClientID %>").val();         
          jQuery.ajax({
              url: "KS.SJ.aspx?action=selectSJKId&SJclassId=" + SJclassId + "&SJKnowledgeId=" +<%=SJKnowledgeId %> +"&SJtypeclassId=" + v, success: function (d) {
                 
                  jQuery("#<%=this.drpSJKnowledge.ClientID %>").empty();
                  jQuery("#<%=this.drpSJKnowledge.ClientID %>").append(d);
              }
          });
      }

      function showScorePubType() {
          var checkrad = jQuery("#<%=this.RdbScorePubType.ClientID %> :radio[checked]").val();
          if (checkrad == "1") {
              jQuery("#pubdate").show();
          } else {
              jQuery("#pubdate").hide();
          }
      }   

      function realtest() {
          var checkrad = jQuery("#<%=this.realtest.ClientID %> :radio[checked]").val();
        
          if (checkrad == "0") {
              jQuery("#<%=this.tbody10.ClientID %>").css("display", "none");
                jQuery("#<%=this.tbody20.ClientID %>").css("display", "");
            } else {
                jQuery("#<%=this.tbody10.ClientID %>").css("display", "");
                jQuery("#<%=this.tbody20.ClientID %>").css("display", "none");
              
            }
        }

  </script>

        <%if (sjclasstype==0){ %>
        <tbody >
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px">
                   <font color="red">*</font> <strong>试卷分类：</strong></td>
                <td class="righttd">
                    &nbsp;<asp:DropDownList ID="DrpClassID" runat="server" onchange="getKS(this.value)">
                        <asp:ListItem Value="0">--选择试卷分类--</asp:ListItem>
                    </asp:DropDownList>
                   <span class="tips"> 建议选择最终级分类</span>
                  </td>
            </tr>
        </tbody>
             <%} else if (sjclasstype==1){ %>
        <tbody>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px">
                    <strong>试卷分类：</strong></td>
            <td class="righttd">
               <div id="sjclassinfo"></div>
                <script>
                    //初始化 加载第一级的试卷分类
                    $(document).ready(function () {
                        loadClass(0,"false");  
                    });
                    //局部刷新  加载分类内容
                    function loadClass(id,ischange) {
                        jQuery.post("../../plus/Exam/GetSJAjax.ashx", { action: "getsjclassinfo",ischange:ischange,folderid:"<%= classId%>",rnd:Math.random(),ParentID: id },
							  function (data) {  
							      if (data != '') {
							          $("#sjclassinfo").append(data);
							      }
							  });
                    }
                    function changeclass(id, parentid, depth) {
                        $("#sjclassinfo").find("label").each(function () {
                            if ($(this).attr("depth")> depth) {
                                $(this).remove();
                            }
                        });
                        if(id>0){
                            $("#ClassID").val(id);
                        }else{
                            $("#ClassID").val("0");
                        }
                        if (parentid=='-1') return;

                        loadClass(id,"true");
                    }

                </script>
                <input type="hidden" name="ClassID" id="ClassID" value="<%=xlclassID %>"/>
            </td>
        </tr>
        </tbody>
            <%} %>


           <% if (MyCache.GetExamSetting(20) == "1"){ %>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>试卷副分类：</strong></td>
                <td class="righttd">
                    <asp:ListBox ID="MoreClassList" runat="server" Width="262px" SelectionMode="Multiple" Height="80px"></asp:ListBox>
                    <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.MoreClassList.ClientID %>');"></a>
                    <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.MoreClassList.ClientID %>');"></a><span>可不选</span>
                </td>
            </tr>
         <%} %>
        <tr>
            <td align="right" class="lefttd" height="30" style="width: 258px">
                <strong>试卷类型：</strong></td>
            <td class="righttd">
             <asp:RadioButtonList ID="realtest" runat="server" Width="280" 
                    RepeatDirection="Horizontal" Height="24px" onclick="realtest()">
              <asp:ListItem Value="0" Selected="True">模拟试卷</asp:ListItem>
              <asp:ListItem Value="1">正规试卷</asp:ListItem>
             </asp:RadioButtonList>
             </td>
        </tr>
          <tr>
            <td align="right" class="lefttd" height="30" style="width: 258px">
                <strong>保存答案：</strong></td>
            <td class="righttd">
             &nbsp;每隔<asp:TextBox ID="TxtAutoSaveTime" runat="server" Width="30" Text="30" style="text-align:center" CssClass="textbox" >30</asp:TextBox>秒自动保存答案。
             </td>
        </tr>
       <tbody id="tbody10" runat="server"  style="display:none;">
    
                 <tr>
                    <td align="right" class="lefttd" height="30" style="width: 258px">
                        <strong>成绩公布方式： </strong></td>
                    <td class="righttd">
                        <asp:RadioButtonList ID="RdbScorePubType" runat="server" 
                            RepeatDirection="Horizontal" RepeatLayout="Flow" 
                            onclick="showScorePubType()">
                                <asp:ListItem Value="0" Selected="True">即时显示成绩（仅适合没有主观题及不需要人工评卷的考试）</asp:ListItem>
                                <asp:ListItem Value="1">指定评卷教师及设定成绩发布时间</asp:ListItem>
                            </asp:RadioButtonList>
                         <div style="display:none;margin:10px;border:1px solid #ccc;padding:10px;" id="pubdate">
                            <strong>评卷教师：</strong>
                            <asp:TextBox CssClass="textbox" ID="TxtPJTeacher" Width="300" runat="server" />
                             <span class="tips">多个评卷老师请用英文逗号隔开。</span>
                            <br />
                            <strong>成绩公布时间：</strong>
                            <asp:TextBox  CssClass="textbox" ID="TxtScorePubDate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" runat="server"></asp:TextBox>
                          </div>
                   </td>
                </tr>
        
                <tr>
                    <td align="right" class="lefttd" height="30" style="width: 258px"><strong>授权考试方式：</strong></td>
                    <td class="righttd">
                        <asp:RadioButtonList ID="RdbAuthorizationType" runat="server" RepeatDirection="Horizontal"  RepeatLayout="Flow" >
                                <asp:ListItem Value="1" Selected="True">准考证</asp:ListItem>
                                <asp:ListItem Value="0">满足以下条件即可参加考试（到“<font color="red">权限控制</font>”设置）</asp:ListItem>
                            </asp:RadioButtonList>                         
                   </td>
                </tr>                
        </tbody>
      
   
               <tr>
                     <td align="right" class="lefttd" height="30" style="width: 258px"><b>类别与年限：</b></td>
                    <td class="righttd">
                        <% if (MyCache.GetSJCacheConfig(4) == "1")
                                     { %><span></span>
                        <%}else{ %><span style="display:none"><%} %>试卷类别：
                      <asp:DropDownList ID="DrpSJTypeID" runat="server">
                       <asp:ListItem Value="0">--选择试卷类别--</asp:ListItem>
                      </asp:DropDownList>
                      <span class="tips">可不选&nbsp;&nbsp;&nbsp;</span>
                      <% if (MyCache.GetSJCacheConfig(3) == "1")
                                     { %><span></span>
                        <%}else{ %><span style="display:none"><%} %>
                      	试卷地区：
                       	<asp:DropDownList ID="DrpProvince" runat="server">
                        <asp:ListItem Value="0">--选择省份--</asp:ListItem>
                       	</asp:DropDownList> 
                       	<span class="tips">可不选&nbsp;&nbsp;&nbsp;</span> </span>
                     	<span> 发布年限：</span>
                       	<asp:DropDownList ID="DropYear" runat="server">
                        <asp:ListItem Value="0">--选择年限--</asp:ListItem>
                       	</asp:DropDownList> 
                       	<span class="tips">可不选&nbsp;&nbsp;&nbsp;</span>      
                       </td>                  
                </tr>
             <% if (MyCache.GetExamSetting(4) == "1"){ %>
                <tr>
                     <td align="right" class="lefttd" height="30" style="width: 258px"><b>多地区选择：</b></td>
                    <td class="righttd">
                      <span> <asp:ListBox ID="ListYear" runat="server" Width="150px"  SelectionMode="Multiple">

                        </asp:ListBox> 可不选</span>   
                       </td>
                </tr>
             <%} %>
            <tr style="display:none">

                <td align="right" class="lefttd" height="30" style="width: 258px"><b>题目属性：</b></td>
                <td class="righttd">&nbsp;
                    <asp:DropDownList ID="drpSJtypeClass" runat="server" onchange="getSJKnowledge(this.value)">
                    <asp:ListItem Value="0">-选择题目属性-</asp:ListItem>
                    </asp:DropDownList>
                    &nbsp;<asp:DropDownList ID="drpSJKnowledge" runat="server">
                        <asp:ListItem Value="0">-选择题目知识点-</asp:ListItem>
                    </asp:DropDownList>
                </td>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>试题添加方式：</strong></td>
                <td class="righttd">
                    <asp:DropDownList ID="Drpdtfs" runat="server" onchange="ChangeDrpdtfs()">
                        <asp:ListItem Value="1">按题型逐题录入</asp:ListItem>
                        <asp:ListItem Value="2">前台随机出题</asp:ListItem>
                       
                    </asp:DropDownList>
                 
                     </td>
            </tr>
          <tbody  id="fromBox" runat="server" style="display:none;" >
           
           <tr>
              <td align="right" class="lefttd" height="30" style="width: 258px"><strong>类型：</strong></td>
                <td class="righttd">
                      <asp:RadioButtonList ID="RadioRndType" runat="server" onclick="showrnst();" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Value="1">按题型添加</asp:ListItem>
                        <asp:ListItem Selected="True" Value="0">随机出题</asp:ListItem>
                    </asp:RadioButtonList>
                    </td>
            </tr>
         <tr id="rndstnum">         
           <td align="right" class="lefttd" height="30" style="width: 258px"><strong>前台随机抽取:</strong></td>
          <td class="righttd"> <asp:TextBox ID="txtFNum" runat="server" CssClass="textbox" value="0" Width="40px"></asp:TextBox> </td>
           </tr>
           <tr class="rndstnum1">  
		    <td align="right" class="lefttd" height="30" style="width: 258px"></td>       
           <td class="righttd"><strong><input type="button" onclick="addTM()" value="添加试题" class="button"/> </strong></td>
          <td class="righttd">  </td>
           </tr>
         <tr class="rndstnum1">    
        <td align="right" class="lefttd" height="30" style="width: 258px">
           
        </td>
        <td class="righttd"> 
           <table width="70%"border="0" cellpadding="1" cellspacing="1"  class="CTable"> 
               <tr  class="CTitle">
                <td style="width: 60px">序号</td>
                <td style="width: 100px">标题</td>
                <td style="width: 80px">题目类型</td>
                <td style="width: 50px">自定义题型</td>
                <td style="width: 50px">抽题数</td>
                <td style="width: 60px">每题分</td>
                <td style="width: 60px">操作</td>
          </tr>  
		  <style>
		  #xts td{padding: 10px 5px !important;}
		  </style>    
             <tbody id='xts'>
             <%
              StringBuilder sb = new StringBuilder();
           
              if (rndSjid > 0)
              {
                  using (DataTable dt = DataFactory.GetDataTable("select top 100 * From KS_SJRndZJ Where sjid=" + rndSjid + " order by OrderID asc"))
                  {
                      if (dt.Rows.Count > 0)
                      {
                          foreach (DataRow dr in dt.Rows)
                          {
                              i++;
                              int xttype = Utils.StrToInt(dr["tmtype"].ToString());
                              sb.AppendLine(string.Format(@"<tr id='t{0}'><td align='center'>第<strong>{0}</strong>大题 <strong></strong></td><td align='center'><input name='qus{0}' id='qus{0}' type='text' value='{1}' style='width:170px;'/> <input type='hidden' name='tmid{0}' value='{2}'/></td>", i, dr["Title"].ToString(), dr["ID"].ToString()));

                              sb.AppendLine(string.Format(@"<td  align='center'><select onchange=setAns(this.value,{0})  name='tmt{0}' id='tmt{0}'>", i));
                              sb.AppendLine("<option value='2'");
                              if (xttype == 2) sb.Append(" selected");
                              sb.Append(">单选题</option><option value='4'");
                              if (xttype == 4) sb.Append(" selected");
                              sb.Append(">对错题</option><option value='5'");
                              if (xttype == 5) sb.Append(" selected");
                              sb.Append(">填空题</option><option value='3'");
                              if (xttype == 3) sb.Append(" selected");
                              sb.Append(">多选题</option><option value='1'");
                              if (xttype == 1) sb.Append(" selected");
                              sb.Append(">主观题</option><option value='6'");
                              if (xttype == 6) sb.Append(" selected");
                              sb.Append(">阅读分析题</option></select>");
                              sb.AppendLine(string.Format(@"</td><td align='center'>{0}</td>", getzdytm(Utils.StrToInt(dr["tmtype"].ToString()), Utils.StrToInt(dr["zdyid"].ToString()),i,classId)));
                              sb.AppendLine("</td><td align='center'><input type='text' name='tms" + i + "' class='textbox' value='"+dr["num"].ToString()+"' style='text-align:center;width:30px'/></td>");
                              sb.AppendLine("<td align='center'><input type='text' name='fs" + i + "' class='textbox' value='" + dr["fs"].ToString() + "' style='text-align:center;width:30px'/>分</td>");
                              sb.AppendLine("<td align='center'><a href='javascript:;' onclick='removeTr(" + i + "," + dr["id"].ToString() + ");return false;'>删除</a></td></tr>");
                            
                          }
                      }
                  }
                  Response.Write(sb.ToString());
              }
         %>
               
      
 
             </tbody>
                  <input type="hidden" name="xtnum6" id="xtnum6" value="<%=i %>" />
           </table>  
        </td>
       </tr>

         </tbody> 



               <tbody id="tbody20" runat="server">
            </tbody>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>开考时间限制：</strong></td>
                <td class="righttd">
                    <asp:RadioButtonList ID="RdbLimitDate" runat="server" onclick="showvaliddate();" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Value="1">启用</asp:ListItem>
                        <asp:ListItem Selected="True" Value="0">不启用</asp:ListItem>
                    </asp:RadioButtonList>
                    <span id="datearea" style="display:none">
                    <script>
                        isHour = 1;</script>
                    &nbsp;有效期：从<asp:TextBox ID="TxtBeginTime" runat="server" CssClass="textbox" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" Width="120"></asp:TextBox>
                    至 
                    <asp:TextBox ID="TxtEndTime" runat="server" CssClass="textbox" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" Width="120"></asp:TextBox>
                    </span>
                      <script>
                          var i=<%=i %>;
                          jQuery(document).ready(function () {
                              showvaliddate();
                              showrnst();
                          });
                          function showrnst() {
                              var checkrad = jQuery("#<%=this.RadioRndType.ClientID %> :radio[checked]").val();
                               if (checkrad == "1") {
                                   jQuery("#rndstnum").hide();
                                   jQuery(".rndstnum1").show();
                               } else {
                                   jQuery(".rndstnum1").hide();
                                   jQuery("#rndstnum").show();
                               }
                           }

                           function showvaliddate() {
                               var checkrad = jQuery("#<%=this.RdbLimitDate.ClientID %> :radio[checked]").val();
                            if (checkrad == "1") {
                                jQuery("#datearea").show();
                            } else {
                                jQuery("#datearea").hide();
                            }
                        }
                        function setAns(v,num)
                        {
                            var tid = jQuery('#<%=this.DrpClassID.ClientID %>').val();
                             <%if (sjclasstype == 1)
                             { %>
                            tid = $("#ClassID").val();
                            <%}%>

                            jQuery.ajax({
                                type: "POST",
                                url: "KS.sj.aspx",
                                data: "tmtype="+v+"&action=zdytm&classid="+tid+"&zdyid="+num,
                                success: function (data) {
                                    jQuery("#select"+num).html(data);
                                  
                                }
                            });
                          
                         
                        }


                        function addTM() {
                            i++;
                            var str = '';
                            var xttype = 2;
                            str += "<tr id='t" + i + "'>";
                            str +=" <td align='center'>第<strong>" + i + "</strong>大题 </td>"
                                
                            str += "<td align='center'><input type='text' name='qus" + i + "' id='qus" + i + "' style='width:170px;'/></td>";

                            str += "<td align='center'> <select onchange=setAns(this.value," + i + ") name='tmt" + i + "' id='tmt" + i + "'>";

                            str += "<option value='2'";
                            if (xttype == 2) str += " selected"
                            str += ">单选题</option><option value='4'";
                            if (xttype == 4) str += " selected"
                            str += ">对错题</option><option value='5'";
                            if (xttype == 5) str += " selected"
                            str += ">填空题</option><option value='3'";
                            if (xttype == 3) str += " selected"
                            str += ">多选题</option><option value='1'";
                            if (xttype == 1) str += " selected"
                            str += ">主观题</option><option value='6'";
                            if (xttype == 6) str += " selected"
                            str += ">阅读分析</option></select>";
                            str += "</td><td align='center'><span id='select"+i+"'> <span></td>";
                            str += "</td><td align='center'><input type='text' name='tms" + i + "' class='textbox' value='1' style='text-align:center;width:30px'/></td>";
                         
                            str += "<td align='center'><input type='text' name='fs" + i + "' class='textbox' value='1' style='text-align:center;width:30px'/>分</td>";
                            str += "<td align='center'><a href='javascript:;' onclick='removeTr(" + i + ",0);return false;'>删除</a></td></tr>";
                            ;  jQuery("#xtnum6").val(i);
                            jQuery("#xts").append(str);
                           
                            setAns(2, i);
                        }
                        function removeTr(i,tmid){
                            if (tmid==0){
                                jQuery("#t"+i).remove();
                            }else{
                                jQuery.ajax({
                                    type: "POST",
                                    url: "KS.sj.aspx",
                                    data: "tmid="+tmid+"&action=DelSubTM",
                                    success: function (data) {
                                        jQuery("#t"+i).remove();
                                    }
                                });

                            }
                        }

                       </script>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>考试时间：</strong></td>
                <td class="righttd">&nbsp;<asp:TextBox ID="TxtKSSJ" runat="server" CssClass="textbox" Text="120" Width="40"></asp:TextBox>
                    分钟 试卷总分： 
                    <asp:TextBox ID="TxtScore" runat="server" CssClass="textbox" Text="100" Width="40"></asp:TextBox>
                    分 答卷次数：<asp:TextBox ID="TxtTimes" runat="server" CssClass="textbox" Text="1" Width="40px"></asp:TextBox>
                    <span class="tips">如果每份考卷只允许每位会员答1次请输入“1”，不限制请输入“0”。</span></td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>试卷属性：</strong></td>
                <td class="righttd">
                    <asp:CheckBoxList ID="ChBoxAttr" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Value="1">推荐</asp:ListItem>
                        <asp:ListItem Value="1">热门</asp:ListItem>
                        <asp:ListItem Value="1">固顶</asp:ListItem>
                        <asp:ListItem Selected="" Value="1">允许发表考后心得</asp:ListItem>
                        <asp:ListItem Value="1">允许马上提交看答案</asp:ListItem>
                        <asp:ListItem Selected="" Value="1">允许保存答案</asp:ListItem>
                        <asp:ListItem Value="1">允许删除考试记录</asp:ListItem>                    
                        <asp:ListItem Selected="" Value="1">启用断电保护(断电后允许打开继续考试)</asp:ListItem>
                        <asp:ListItem Value="1">试卷全屏防作弊(仅允许考生用IE浏览器)</asp:ListItem>
                        <asp:ListItem Selected="" Value="1">禁止右键及选择</asp:ListItem>
                        <asp:ListItem Selected="" Value="1">禁止F5键刷新</asp:ListItem>
                        <asp:ListItem Value="1">题目及单多选题题目答案顺序打乱</asp:ListItem>
                     
                    </asp:CheckBoxList>
                    <%
                            if (MyCache.GetCacheConfig(72) == "1")
                              {
                                %>
                    <asp:CheckBox ID="CkbShowOn3G" runat="server" Checked="true" Text="发布到手机版" />
                    <%
                            }
                                    if (MyCache.GetCacheConfig(80) == "1")
                                    {
                                        Response.Write("&nbsp;&nbsp;<strong>发布到：</strong>");
                                        if (MyCache.GetAccountAPIConfig("sina", "enable") == "true")
                                        {
                                            Response.Write(@"<label><input type='checkbox' name='addToSina' id='addToSina' value='1' onclick=""checkSocialToken(this,'sina','" + Kesion.BLL.BaseFun.GetRewriteUrl("sinalogin") + "');\"/>新浪微博</label>");
                                    
                                        }
                                        if (MyCache.GetAccountAPIConfig("qq", "enable") == "true")
                                        {
                                            Response.Write(@"<label><input type='checkbox' name='addToQQ' id='addToQQ' value='1' onclick=""checkSocialToken(this,'qq','" + Kesion.BLL.BaseFun.GetRewriteUrl("qqlogin") + "');\"/>腾讯微博</label>");
                                            Response.Write(@"<label><input type='checkbox' name='addToQQLog' id='addToQQLog' value='1' onclick=""checkSocialToken(this,'qq','" + Kesion.BLL.BaseFun.GetRewriteUrl("qqlogin") + "');\"/>QQ日志</label>");
                                            Response.Write(@"<label><input type='checkbox' name='addToQQShuoShuo' id='addToQQShuoShuo' value='1' onclick=""checkSocialToken(this,'qq','" + Kesion.BLL.BaseFun.GetRewriteUrl("qqlogin") + "');\"/>QQ说说</label>");

                                        }
                                    } %></td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>应用成绩等级：</strong></td>
                <td class="righttd">&nbsp;
                    <asp:DropDownList ID="DrpCjdID" runat="server">
                        <asp:ListItem Value="0">--不应用成绩等级--</asp:ListItem>
                    </asp:DropDownList>
                    试卷来源：<asp:TextBox ID="TxtCopyFrom" runat="server" CssClass="textbox" Width="100px"></asp:TextBox>
                    试卷作者： 
                    <asp:TextBox ID="TxtAuthor" runat="server" CssClass="textbox" Width="100px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>试卷介绍：</strong></td>
                <td class="righttd">
                    <asp:TextBox ID="TxtIntro" runat="server" style="width:98%;height:200px;" TextMode="MultiLine" Width="100px"></asp:TextBox>
                    <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtIntro.ClientID, "Basic", 0, false, true, false,false,true);%></td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>试卷状态：</strong></td>
                <td class="righttd">
                    <asp:RadioButtonList ID="RdbVerify" runat="server" Height="24px" RepeatDirection="Horizontal" Width="280px">
                        <asp:ListItem Selected="True" Value="1">已审核</asp:ListItem>
                        <asp:ListItem Value="0">未审核</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td align="right" class="lefttd" height="30" style="width: 258px"><strong>关键字Tags：</strong></td>
                <td class="righttd">
                    <asp:TextBox ID="TxtKeyTags" runat="server" CssClass="textbox" Width="300px" />
                    【<a href="javascript:;" onclick="GetKeyTags()" style="color:green">根据试卷名称自动获取Tags</a>】&nbsp;&nbsp;<font class="tips">多个tags请用空格隔开</font> </td>
            </tr>


        </tbody>
        </table>
      </div>
      
      
      <div class="tab-page" id="tab2"  >
		  <h2 class="tab">权限控制</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("tab2"));
			</script>
            <script>
                jQuery(document).ready(function () {
                    showpurview();
                });
                function showpurview() {
                    var checkrad = jQuery("#<%=this.RdbMustLogin.ClientID %> :radio[checked]").val();
                    if (checkrad == "0") {
                        jQuery("#purview").hide();

                        jQuery("#pprice").hide();
                        

                    } else {
                        jQuery("#purview").show();
                        free();
                      
                       
                    }
                  
                }


                function free() {
                    var checkrad = jQuery("#<%=this.RadioButtonList2.ClientID %> :radio[checked]").val();
                    if (checkrad == "0") {
                        jQuery("#pprice").hide(); 
                        jQuery("#shoufei").hide();
                        jQuery("#userfree").hide();

 
                    } else if (checkrad == "1") {
                        jQuery("#purview").show();
                        jQuery("#pprice").show();
                         dobuy();
                        douser();
                       
                    } else {
                        jQuery("#purview").show();
                        jQuery("#pprice").show();
                    }
                }
                function dobuy() {
                    //是否允许单购
                    var checkrad = jQuery("#<%=this.RadioButtonList1.ClientID %> :radio[checked]").val();
                    if (checkrad == "0") {
                        
                        jQuery("#shoufei").hide();
 
                    } else if (checkrad == "1") {
                        jQuery("#purview").show();
                        jQuery("#pprice").show();
                        jQuery("#shoufei").show();
                       
                    } 


                }
                 function douser() {
                    //是否指定用户组免费
                    var checkrad = jQuery("#<%=this.RadioButtonList3.ClientID %> :radio[checked]").val();
                    if (checkrad == "0") {
                        
                        jQuery("#userfree").hide();
 
                    } else if (checkrad == "1") {
                        jQuery("#purview").show();
                        jQuery("#pprice").show();
                        jQuery("#userfree").show();
                       
                    } 


                }

            </script>
    
       <table style="width:100%;margin:0 auto;" cellpadding="2" cellspacing="1" class="CTable no-borderTable">
        <tr>
             <td align="right" class="lefttd" height="30" style="width: 258px">
                <strong>考试需要登录：</strong></td>
            <td class="righttd">
                &nbsp;
              <asp:RadioButtonList ID="RdbMustLogin" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
              <asp:ListItem Value="1" Selected>需要登录</asp:ListItem>
              <asp:ListItem Value="0">不需要(允许游客做题)</asp:ListItem>
              </asp:RadioButtonList>
                </td>
        </tr>
            <tbody id="purview">  
              <tr>
                        <td align="right" class="lefttd" height="30" style="width: 258px">
                            <strong>权限：</strong></td>
                        <td class="righttd">
                            <div class="message">
                            <table>
                 <tr >
              <td align="right" class="lefttd" height="30" style="width: 180px">
                  <strong>用户组：</strong></td>
              <td class="righttd">
                  <div ID="GroupPanel" runat="server"></div>
                  <span class="tips">tips：不限制用户组，请不要勾选 。</span>
              </td>
          </tr>
         <tr>
              <td align="right" class="lefttd" height="30" style="width: 180px">
                  <strong>考试部门：</strong></td>
              <td class="righttd">
                     <asp:ListBox ID="LstDepartID" SelectionMode="Multiple" runat="server" Width="250px" Height="140px">
                       </asp:ListBox>
                      <br />
                  <span class="tips">tips：按Ctrl或Shift可以多选。<a href="javascript:;" onclick="jQuery('#<%=this.LstDepartID.ClientID %> option').attr('selected',false);">取消选中</a></span>
              </td>
          </tr>
             </table> 
       </div>
                            
          </td>                              
    
               <tr>
                        <td align="right" class="lefttd" height="30" style="width: 258px">
                            <strong>收费：</strong></td>
                        <td class="righttd">
                            <div class="message">
                            <table>
                                <tr>
                                    <td align="right" class="lefttd" height="30" style="width: 180px">
                                    收费方式：
                                    </td>
                                     <td>
                                       <asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatDirection="Horizontal" onclick="free()" Height="24px">
                                <asp:ListItem Value="0" Selected="True">全部免费</asp:ListItem>
                                <asp:ListItem Value="1" >全部付费</asp:ListItem>
                               <%-- <asp:ListItem Value="2">指定用户免费</asp:ListItem>
                                <asp:ListItem Value="3">套餐包</asp:ListItem>--%>
                            </asp:RadioButtonList>
                                    </td>
                
                                  </tr>    
            <tbody id="pprice">  
                
       <tr >
             <td align="right" class="lefttd" height="30" style="width: 180px">
              <strong>是否允许单购：</strong></td>
               <td class="righttd"><div class="message">
               <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" Height="24px" onclick="dobuy()">
                     <asp:ListItem Value="0" >否</asp:ListItem>
                      <asp:ListItem  Value="1" Selected="True">是</asp:ListItem>
                </asp:RadioButtonList>
                   <div id="shoufei">
                     <strong>计费类型：</strong><asp:RadioButtonList ID="ChargeType" runat="server" RepeatDirection="Horizontal" Height="24px">
                     <asp:ListItem Value="0" Selected="True">点券</asp:ListItem>
                      <asp:ListItem  Value="1">资金(人民币)</asp:ListItem>
                      <asp:ListItem  Value="2">积分</asp:ListItem>
                	</asp:RadioButtonList>
                 
                   		<div class="mt5">
                            <strong>所需</strong> <asp:TextBox CssClass="textbox" ID="TxtMoney" Text="0" runat="server" Width="60px"></asp:TextBox>.元/积分
                            <asp:CheckBox ID="VIPCheck" runat="server" Text="是否VIP免费" />
                        </div>
           			</div>
                   </div>
                   

             </td>
          </tr>
          


                 <tr >
                    <td align="right" class="lefttd" height="30" style="width: 180px">
                  <strong>是否指定用户组免费：</strong></td>
                  <td class="righttd">
                 <div class="message">
                  <asp:RadioButtonList ID="RadioButtonList3" runat="server" RepeatDirection="Horizontal" onclick="douser()" Height="24px">
                   <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                   <asp:ListItem Value="1" >是</asp:ListItem>
                            
               </asp:RadioButtonList>
                     <div id="userfree">
                      <div class="l_height36"><strong>用户组：</strong></div>
                       <div ID="buyGroupPanel" runat="server"></div>
                      <div class="l_height36"><strong>部门：</strong></div>

                <asp:ListBox ID="BuyDepartList" SelectionMode="Multiple" runat="server" Width="250px" Height="140px">
                  </asp:ListBox>
            		<br /><span class="tips">tips：不限制用户组,部门请不要勾选 。部门按Ctrl或Shift可以多选，<a href="javascript:;" onclick="jQuery('#<%=this.BuyDepartList.ClientID %> option').attr('selected',false);">取消选中</a></span>
                           
                     </div>
              </div>
             </td>
          </tr>

              </tbody>
              </table>
              </div>
         </td>
        </tr>  
       </tbody>

                         
                   

      </table>
            <script type="text/javascript">
                showtips('<span class="state"><strong>说明：</strong><br /></span>试卷权限注意事项<br/>1.先要有考试权限<br /> 2.然后在有购买权限');
		</script>
      </div>
      
      <div class="tab-page" id="tab1">
		  <h2 class="tab">SEO选项</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("tab1"));
			</script>
    
    <table style="width:100%;margin:0 auto;" cellpadding="2" cellspacing="1" class="CTable no-borderTable">
     <tr>
       <td class="lefttd" align="right" style="width:258px;"><strong>页面标题：</strong></td>
       <td class="righttd">
          <asp:TextBox ID="TxtSeoTitle" runat="server" Width="300px"  CssClass="textbox" />
         <div class='tips'>留空则默认显示文章名称,模板里请用标签{KS:Field:SEOTitle}调用。</div>
        </td>
     </tr>
     <tr>
       <td class="lefttd" align="right" style="width:258px;"><strong>页面关键字：</strong>(meta_keywords)</td>
       <td class="righttd">
          <asp:TextBox TextMode="MultiLine" Rows="5" ID="TxtSeoKeyWords" runat="server" Width="300px"  CssClass="textbox" />
         <div class='tips'>留空则默认显示文章里设置的KeyWords,模板里请用标签{KS:Field:SEOKeyWords}调用。</div>
        </td>
     </tr>
     <tr>
       <td class="lefttd" align="right" style="width:258px;"><strong>页面描述：</strong>(meta_description)</td>
       <td class="righttd">
          <asp:TextBox TextMode="MultiLine" Rows="5" ID="TxtSeoDescription" runat="server" Width="300px"  CssClass="textbox" />
         <div class='tips'>留空则默认显示文章简介,模板里请用标签{KS:Field:SEODescription}调用。</div>
        </td>
     </tr>
    </table>
     </div>
      
      
   </div>
      <asp:Label ID="labsjinfo" runat="server"></asp:Label>
      <div style="clear:both;text-align:center">
        <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
      
    </asp:Panel>

        <script>
            
            function CheckForm() {
                if (jQuery('#<%=this.TxtTitle.ClientID %>').val() == '') {
                    KesionJS.Alert('试卷名称必须输入!', "jQuery('#<%=this.TxtTitle.ClientID %>').focus()");
                    return false;
                }
                <%if (sjclasstype==0){ %>

                if (jQuery('#<%=this.DrpClassID.ClientID %>').val() == '0') {
                    KesionJS.Alert('请选择试卷分类!', "jQuery('#<%=this.DrpClassID.ClientID %>').focus()");
                    return false;
                }
                <%}else if (sjclasstype == 1){%>
                if(jQuery('#ClassID').val() == '0')
                {  
                    KesionJS.Alert('请选择试卷分类!');
                    return false;
                }
                <% }%>
                return true;
            }
            function GetKeyTags() {
                var text = escape(jQuery('#<%=this.TxtTitle.ClientID %>').val());
            if (text != '') {
                jQuery('#<%=this.TxtKeyTags.ClientID %>').val('请稍等,系统正在自动获取tags...').attr("disabled", true);
                jQuery.get("../../plus/ajaxs.ashx", { a: "GetTags", text: text },
				  function(data) { jQuery('#<%=this.TxtKeyTags.ClientID %>').val(unescape(data)).attr("disabled", false); });
                } else { KesionJS.Alert('对不起,请先输入试卷名称!', "jQuery('#<%=this.TxtTitle.ClientID %>').focus();"); }
        }

        function ChangeDrpdtfs() {
            var select = document.getElementById("<%=this.Drpdtfs.ClientID %>").value; 
                var myarea = document.getElementById("<%=this.fromBox.ClientID %>");
                if (select == 2) {

                    jQuery("#<%=this.fromBox.ClientID %>").show();
                    //  myarea.style.display = "inline";
                } else {
                    myarea.style.display = "none";
                }
            }
    </script>
    
  </div>  
</asp:Content>
