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

<!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("ExamPrint_Title")%></title>

    <link href="Themes/Css/ExamGlobal.css" rel="stylesheet" type="text/css" />
    <%--<link href="../../Themes/Styles/Site.css" rel="stylesheet" type="text/css" />--%>
    <link href="../../Themes/Scripts/artDialog/skins/opera.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>
    <link href="Themes/Css/ExaminationCss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Training/Learn/m/ckplayer/ckplayer.js" charset="utf-8"></script>
    <script src="/Live/swfobject.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/jQuery.path2html.js" type="text/javascript"></script>
    <style type="text/css">  
            * { font-size: 9pt; }
body { margin: 0px; padding: 0px; font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif; color: #000000; }   
/**
按钮 begin
**/
.button { display: inline-block; text-decoration: none; font: 8px/8px HelveticaNeue, Arial; padding: 0px 11px; border: 1px solid #FFF; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; cursor: pointer; font-family: 微软雅黑, 宋体, Arial, Helvetica, Verdana, sans-serif; font-size: 9pt; margin-top: 1px; margin-left: 2px; margin-bottom: 2px; line-height: 25px; color: #000; outline: none; background-image: url('../images/datagrid_header_bg2.gif'); background-repeat: repeat-x; border: 1px solid #ccc; }
.button.green:hover { color: #FFF; border: solid 1px #3399dd; background: #2288cc; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#33bbee', endColorstr='#2288cc'); background: linear-gradient(top, #33bbee, #2288cc); background: -moz-linear-gradient(top, #33bbee, #2288cc); background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#33bbee), to(#2288cc)); text-shadow: -1px -1px 1px #1c6a9e; }
      
        .activeQuetion .ques_Context{ display:block;}
        .activeQuetion2 .ques_Context{ display:block;}    
        .exam_Title input{ width:100px;}
        #examContext2{ height:auto; width:auto; }
        #examContext2 ul{ width:550px; }
        #examContext2 ul li{ float:left; width:100px;  }
        .exam_Title{ font-weight:100; }        
        .exam_Prompt, .exam_Num { color: #555555 !important; }
        .center1{  font-size:16px;font-weight:bold;  }
        .center2{  font-size:14px;}
        .examContext div, .examContext li, .examContext label { font-size: 12px; color: #555555; letter-spacing: 1px; }
        
        .exam_result textarea{ border:0px;}
        .exam_result_input_text{ width:100px;  border-bottom:1px solid #ccc; border-top:0px; border-left:0px; border-right:0px; background-image: url("/Themes/Images/content_bg.png"); }        
        .textarea{ width:100px; height:40px; }
        .tixing{ font-weight:bold; }
        .ques_Context { max-width:100%; }
        .exam_Prompt2{color: #555555 !important;}
    </style>
    <script type="text/javascript">

        $(function () {
            var $list = $(".ques_Context"); //题目对象            
            if ($list.length > 0) {//页面有错误
                for (var i = 0; i < $list.length; i++) {
                    $list.addClass("ques_Context activeQuetion");
                }
            }
        });

        //答案
        function pintans() {
            var bdhtml = window.document.body.innerHTML; //获取当前页的html代码
            var sprnstr = "<!--startprint1-->"; //设置打印开始区域
            var eprnstr = "<!--endprint1-->"; //设置打印结束区域
            var prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
            prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
            window.document.body.innerHTML = prnhtml;
            window.print();
//            WebBrowser.ExecWB(7, 1);           
            window.document.body.innerHTML = bdhtml;

        }

        //题目
        function pintque() {
            var bdhtml = window.document.body.innerHTML; //获取当前页的html代码
            var sprnstr = "<!--startprint2-->"; //设置打印开始区域
            var eprnstr = "<!--endprint2-->"; //设置打印结束区域
            var prnhtml = bdhtml.substring(bdhtml.indexOf(sprnstr) + 18); //从开始代码向后取html
            prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr)); //从结束代码向前取html
            window.document.body.innerHTML = prnhtml;
            window.document.body.style.overflow = "auto";
            window.print();
            //            WebBrowser.ExecWB(7, 1);           
            window.document.body.innerHTML = bdhtml;
         }
    </script>

</head>
<body style="overflow:auto;"  >

<object ID='WebBrowser' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object> 

    <form id="form1" runat="server">
    <a class="button green"  onclick="javascript:pintque();" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPrint_dysj")%>" ><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPrint_dysj")%></a>
    <a class="button green"  onclick="javascript:pintans();" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPrint_dysj")%>" ><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPrint_dyda")%></a>
    <div id="container" >
        <div id="examItem">
            <div id="ei_Container">
                <!--startprint1-->
                <div id="examContext2">
                    <center class="center1" ><%=ExaminationPaperTitle %></center>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_zqda")%>：<ul><%=AnserHtml.ToString() %></ul>
                </div>
                <!--endprint1-->
                <div class="clear" ></div>
                <!--startprint2-->
                <div id="examContext" class="examContext">
                    <center class="center1"><%=ExaminationPaperTitle %></center>
                    <center class="center2"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjzf")%>：<%=SumScore %> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_fen")%>（<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-jgfs")%><%=PassScore%>）　　<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-kssj")%>：<%=QuestionDate.ToString()%><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Courseware_Minute")%>　</center>
                    <center class="center2"><%=StuSocre %>　学员姓名：<%=modelResult.Result_ToUserName %></center>

                   <%=QuestionHtml.ToString() %>
                </div>  
                <!--endprint2-->
            </div>
        </div>
    </div>
    </form>

    <script type="text/javascript">
        var i = 0;
        $(".annex").each(function () {
            $(this).attr("id", "aa" + i);
            var fileUrl = $(this).html(); // text();
            window.path2html("aa" + i, fileUrl);
            i++;
        });
        var j = 0;
        $("annex").each(function () {
            $(this).attr("id", "aa" + j);
            var fileUrl = $(this).text();
            window.path2html("aa" + j, fileUrl);
            j++;
        });


        $("img").each(function (i) {
            var imgsrc = $(this).attr("src");
            if (imgsrc.indexOf("image") < 0 && imgsrc.indexOf("/Resources/SharesFiles") < 0 && imgsrc.indexOf("/Resources/ExamImportWord") < 0) {
                $(this).attr("src", "/Resources/ExamImportWord/" + imgsrc);
                $(this).attr("width", "80px");
                imgsrc = "/Resources/ExamImportWord/" + imgsrc;
            }
        });

        $("a[rel^='colorbox']").colorbox(
{ title: " ", slideshow: true, slideshowAuto: false, previous: "上一张", next: "下一张", close: "关闭", slideshowStart: "播放", slideshowStop: "暂停", current: "第 {current} 张 (共{total}张)" });     
     

    </script>
</body>
</html>