<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_SJAddTM" Title="添加题目" Codebehind="KS.SJAddTm.aspx.cs" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
<script type="text/javascript" charset="utf-8" src="/KS_Inc/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/KS_Inc/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/KS_Inc/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
     
 <KS:TopNav ID="TopNav1" runat="server" Text="添加题目" />
<div class="content-area">    
    <script>
        function CheckForm() {
            var tnum=jQuery("#<%=this.TxtNum.ClientID%>").val();
         
            for(var i=1;i<=tnum;i++)
            {
                if (eval("editor"+i+".getContent()")=='' || eval("editor"+i+".getContent()")==undefined )
                {
                    alert("第"+i+"题题目内容不能为空");
                    return false;
                }
                var  tmtype =jQuery("#tmtype"+i).val();   
             
                if (tmtype==2 || tmtype==3)
                {
                    var opnet=jQuery("#optionnum"+i).val();
                    var latter='';
                    for(var j=1;j<=opnet;j++)
                    {
                    //editor2appans
                        //if (jQuery("#appans"+i+j).val()=='' || jQuery("#appans"+i+j).val()==undefined)
                      if (eval("editor"+tmtype+"appans"+i+j+".getContent()")=='' || eval("editor"+tmtype+"appans"+i+j+".getContent()")==undefined )
                        {
                          alert("第" + i + "题选项内容不能为空");
                          eval("editor" + tmtype + "appans" + i + j + ".focus()");
                            return false;
                        }
                      
                    }
                    if ($("input[name='answer"+i+"']:checked").val()=='' || $("input[name='answer"+i+"']:checked").val()==undefined)
                    {
                        alert("第"+i+"题标准答必须选择!");
                        return false;
                    } 
                }              

            }
            
          
        }
        function showansweroption(v, n) {
            for (i = 2; i <= 9; i++) {
                jQuery("#l" + n + '' + i).hide();
                jQuery("#a1"+n+""+i).hide();
            }
            for (var i = 2; i <= v; i++) {
                jQuery("#l" + n + '' + i).show();
                jQuery("#a1"+n+""+i).show();
            }
                   

        }
        function showansweroption1(v,type,i) {
            for (var ii = 3; ii <= 9; ii++) {
                jQuery("#l"+type+""+i+"" + ii).hide();
                jQuery("#a1"+type+""+i+"" + ii).hide();
            }
            for (var ii = 3; ii <= v; ii++) {
                jQuery("#l"+type+""+i+"" + ii).show();
                jQuery("#a1"+type+""+i+"" + ii).show();
            }
         
        }

        function replaceCk(obj, id) {
            var um = <%=Kesion.APPCode.EditorAPI.EditorTag("ExamEditorTag")%>.getEditor(id,{toolbars:[<%=Kesion.APPCode.EditorAPI.EditorToolBar("Basic")%>],wordCount:false,elementPathEnabled:false,initialFrameHeight:120});
            obj.style.display = 'none';
        }
        function settmtype(v, n) {
            jQuery.get("KS.SJAddTm.aspx", { action: "getanswer", num: n, tmtype: v }, function (v) {
               // alert(v);

                for (var ii = 1; ii <= n; ii++)
            {
                jQuery('#showanswer'+ii).html(unescape(v));


            }
            });
        }
         function replaceEditor(id) {
                    
               UE.delEditor(id)            
               <%=Kesion.APPCode.EditorAPI.EditorTag("ExamEditorTag") %>.getEditor(id,{toolbars:[<%=Kesion.APPCode.EditorAPI.EditorToolBar("Basic")%>],initialFrameWidth:580,initialFrameHeight:80,wordCount:false,autoHeightEnabled:false,minFrameHeight:80,elementPathEnabled:false });
            }
        function loadKnowledge(n) {
            var str = '<select name="KnowledgeID' + n + '" id="KnowledgeID' + n + '"><option value="0">===选择知识点===</option></select>';
            jQuery("#showKnowledge"+n).html(str);
            jQuery("#knowledgeBtn"+n).hide();
            jQuery.get("KS.SjAjax.ashx", { action: "getknowledge", classid: <%= Utils.StrToInt(KSCMS.S("ClassID")) %> }, function(v) {
                jQuery("#KnowledgeID"+n).append(v);
            });
        }
	 </script>
  
	 <asp:Label ID="LabTMArea" runat="server"></asp:Label>
        
    
      <asp:TextBox ID="TxtClassID" style="display:none" runat="server" />
      <asp:TextBox ID="TxtSJID" style="display:none" runat="server" />
      <asp:TextBox ID="TxtNum" style="display:none" runat="server" />
      <asp:TextBox ID="TxtTypeId" style="display:none" runat="server" />
      <asp:TextBox ID="TxtIsRndSj" style="display:none" runat="server" />
        <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
   
</asp:Content>
