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

<!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 id="Head1" runat="server">
    <title></title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
    <link href="Themes/Css/ExamGlobal.css" rel="stylesheet" type="text/css" />
    <link href="Themes/Css/ExamIntroduceCss.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/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            var examKey = QueryString("ExamKey");
            if (!examKey || examKey.length < 1) {
                showTipsMsg("页面加载不正确，请刷新重新尝试.", 4000, 5);
            }
            $("#btnStartExam").click(function () {
                if (!examKey || examKey.length < 1) {
                    showTipsMsg("页面加载不正确，请刷新重新尝试", 3000, 5);
                    return false;
                }
                $("#handleIcon").fadeIn(100);
                $.ajax({
                    url: "CreateExam.ashx",
                    type: "post",
                    data: { "ExamKey": examKey, "EPKey": QueryString("EPKey") },
                    dataType: "text",
                    success: function (data) {
                        var result = data ? parseInt(data) : -1;
                        if (result == -3) {
                            top.showTipsMsg("随机试卷数据异常，可能是随机试卷要求的数据和管理员配置的数据不一致所造成，请联系管理员！", 4000, 5);
                        } else if (result < 0) {
                            top.showTipsMsg("页面数据不正确，请刷新或者重新登录尝试", 2000, 5);
                        } else {
//                            window.location = "/Training/Exam/ExaminationMoblie.aspx?exam=<%=Request["exam"] %>&HashKey=" + data;
                            window.location = "/Training/Exam/ExaminationMoblie.aspx?exam=<%=Request["exam"] %>&HashKey=" + data + "&&EPKey=" + QueryString("EPKey");
                            var list = top.art.dialog.list; //关闭上层所有的对话框
                            for (var i in list) {
                                list[i].close();
                            };
                        }
                        $("#handleIcon").fadeOut(100);
                    },
                    error: function () {
                        top.showTipsMsg("页面数据不正确，请刷新或者重新登录尝试.", 2000, 5);
                        $("#handleIcon").fadeOut(100);
                    }
                });
            });
            $("#continueClick").click(function () {
                if ($(this).attr("data") == "" || $(this).attr("data").length < 1)
                    return false;
//                window.location = "/Training/Exam/ExaminationMoblie.aspx?HashKey=" + $(this).attr("data");
                window.location = "/Training/Exam/ExaminationMoblie.aspx?exam=<%=Request["exam"] %>&HashKey=" + $(this).attr("data") + "&&EPKey=" + QueryString("EPKey");
                var list = top.art.dialog.list; //关闭上层所有的对话框
                for (var i in list) {
                    list[i].close();
                };
                return false;
            });
        });
    </script>
</head>
<body>
    <div id="exam_Priview"style="width:100%;" >
        <div id="exam_Title">
            <h1 id="Exam_TitleInfo" runat="server">
                无</h1>
        </div>
        <div id="exam_Context">
        <div id="newsty1"style="width:100%;">
            <fieldset id="exam_Info" style="width:100%;">
                <legend>考卷信息</legend>
                <ul id="examInfo">
                    <li>有效日期：<label runat="server" id="Exam_StartDate">无</label>
                        ～
                        <label id="Exam_EndDate" runat="server">
                            无</label></li>
                    <li>考试时长：<label runat="server" id="Exam_SumDate">无</label>
                        分钟</li>
                    <li>题目总数：<label runat="server" id="Exam_SumCount">无</label></li>
                    <li>试卷总分：<label runat="server" id="Exam_SumScore">无</label>
                        分</li>
                    <li>及格分数：<label runat="server" id="Exam_PassScore">无</label>
                        分</li>
                    <li>试卷类型：<label runat="server" id="Exam_Type">无</label>
                    </li>
                </ul>
            </fieldset>
            </div>
            <fieldset id="examDiscription" >
                <legend>考卷说明</legend>
                <div class="exam_DisContext">
                    <pre id="exam_DisContext" runat="server">无</pre>
                </div>
            </fieldset>
            <span id="promptTxt" runat="server"></span>
            <div id="btnBar" >
                <a href="javascript:void(0)" id="btnStartExam"
                    runat="server" class="examLink">开始考试</a> <a href="javascript:void(0)" id="continueClick"
                        runat="server" class="examLink" style="display: none;">继续考试</a> <a href="../ExamPlan/MyExamPlan_ListMoblie.aspx"
                            id="btnCloseWindow" class="examLink">&nbsp;返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;回&nbsp;</a>
            </div>
        </div>
    </div>
    <div id="handleIcon">
        正在准备考试信息...请稍候</div>
</body>
</html>
