<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SmartQuestion.aspx.cs" Inherits="RM.Web.Training.Chapter.SmartQuestion" %>

<!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><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_Title")%></title>
    <link href="../Exam/Themes/Css/ExamGlobal.css" rel="stylesheet" type="text/css" />
    <link href="../../Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="../../Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>    
      <script src="../../Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/Validator/JValidator.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <style type="text/css">
        ul li label{ padding-left:5px; margin-left:10px; }
        ul li { margin-top:6px; margin-bottom:5px; }
        ul li input{ padding-right:2px; }
        ul{ margin-left:5px; }        
    </style>

</head>
<body>
    <form id="form1" runat="server">
    <div >
        <ul>	
        <%if (string.IsNullOrEmpty(ctid))
          {%>
            <li>
            	<span>学习计划：</span>
                <label><input class="items_type" name="plan_type" value="-1" type="radio" checked="checked" />无</label>
                <%=CustomChar%>

            </li>
            <%} %>
        <li>
            <span>       　标签名：</span>
            <label><input class="items_type" name="items_tag" value="-1" type="radio" checked="checked" />无</label><%=tagstr %>
        </li>        
        	<li>
            	<em><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjlx")%>：</em>
                <label><input class="items_type" name="items_type" value="0" type="radio" checked="checked" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_suiji")%></label>
                <%=qtype %>                 
            </li>
             
            <li>
            	<em><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_stnandu")%>：</em>
                <label><input class="rank" name="rank" value="0" type="radio" checked="checked" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_easy")%></label>
                <label><input class="rank" name="rank" value="1" type="radio" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_yiban")%></label>                
                <label><input class="rank" name="rank" value="2" type="radio" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_nan1")%></label>
                <label><input class="rank" name="rank" value="3" type="radio" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_kunnan")%></label>
                <label><input class="rank" name="rank" value="4" type="radio" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_hennan")%></label>

            </li>
            <li>
                <center style="padding-top:10px;" >
                <span><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("RandomQue_Num")%>：</span>
                <input type="text" class=""txt" style="width:50px" id="queNum"/>
                <input style = "display:none;" type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_learn")%>30<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ti")%> " class="button"  onclick="javascript:znxt(1);" />
                <input style = "display:none;" type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_learn")%>60<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ti")%> " class="button"  onclick="javascript:znxt(2);" />
                <input style = "display:none;"  type="button" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_learn")%>90<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ti")%> " class="button"  onclick="javascript:znxt(0);" />
                <input  type="button" value="开始<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_learn")%>" class="button"  onclick="javascript:znxt(0);" />
                </center>
            </li>
        </ul>            
    </div>
    </form>

    <script type="text/javascript">
        function znxt(num) {
            var queNum = 0;
            var queNum =$("#queNum").val();
            if(queNum == undefined || queNum ==null ||  queNum =="")
            {
                alert("请输入题数！");
                return;
            }
            var re = /\d[^.]+/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/   
            if(!re.test(queNum)){  
                alert("请输入数字或正整数！");  
                 return;  
            }else if(queNum<=0){  
                alert("请输入大于0的数字");  
                 return;  
            }  
            if (num == 1) {queNum = 30; }
            if (num == 2) { queNum = 60; }
            if (num == 3) { queNum = 90; }
            var items_type = $("input[name='items_type']:checked").val();
            var plan_type = $("input[name='plan_type']:checked").val();
            var rank = $("input[name='rank']:checked").val();
            var items_tag = $("input[name='items_tag']:checked").val();
            if (items_type == undefined && rank == undefined){
                alert("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_qxctsjlxhstnd")%>!");
                return;
            }
            /*
            if (queNum.length <= 0) {
                $("#queNum").focus();
                alert("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_qxsrcts")%>!");
                return;
            }
            if (!isIntegerOrNull(queNum)) {
                $("#queNum").select();
                alert("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SmartQuestion_qxctsjlxhstnd")%>!");
                return;
            }
            
            */
            
            
             if(window.parent.frames["target_right"] != undefined){
                window.parent.frames["target_right"].location = "/Training/Chapter/ChapterList.aspx?action=znct&queNum=" + queNum + "&plan_type="+plan_type+"&rank=" + rank + "&items_type=" + items_type + "&ctid=<%=ctid %>&tags="+encodeURI(items_tag)+"";
                            }else{
            parent.document.getElementById("main").src = "/Training/Chapter/ChapterList.aspx?action=znct&queNum=" + queNum + "&plan_type="+plan_type+"&rank=" + rank + "&items_type=" + items_type + "&ctid=<%=ctid %>&tags="+encodeURI(items_tag)+"";
            }
            Loading(true);
            OpenClose();
        }
    </script>
</body>
</html>
