⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showexamitem.jsp

📁 培训考试系统代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%--
/**
 * Copyright  1988-2004, Huawei Tech. Co., Ltd.
 * filename: ShowExamItem.jsp
 * description: 
 * date: 2004-06-14
 * @author 黄育源
 * @version 3.0
 *
 * History:         // 历史修改记录
 * <author>  <time>   <version >   <desc>
 */
--%>
<%@  page language="java" contentType= "text/html; charset=gb2312"%>

<%@ page import = "com.huawei.icd30.common.systemconfig.*" %>
<%@ page import = "com.huawei.icd30.agt.util.*" %>
<%@ page import = "java.util.*" %>

<% 
    String maxCountStr = (String)session.getAttribute("maxCount");
    String userCountStr = (String)session.getAttribute("userCount");
    String examTimeStr = (String)session.getAttribute("examTime");
    String titleStr = (String)session.getAttribute("title");
    String examId = (String)session.getAttribute("examId");
    
    int maxCount = 0;
    int leaveCount = 0;
    int examTime = 0;
    
    String startTimeStr = request.getParameter("startTime");
    long startTime = 0l;
    if(null != startTimeStr)
    {       
        startTime = Long.parseLong(startTimeStr);
    }
    
    if(maxCountStr != null)
    {
        maxCount = Integer.parseInt(maxCountStr);
        leaveCount = maxCount - Integer.parseInt(userCountStr);
    }

    if(examTimeStr != null)
    {
       examTime = Integer.parseInt(examTimeStr);
    }
   
%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
	SCROLLBAR-FACE-COLOR: #d6efff; SCROLLBAR-HIGHLIGHT-COLOR: #9E9E9E; SCROLLBAR-SHADOW-COLOR: #9E9E9E; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #666666; SCROLLBAR-TRACK-COLOR: #d6efff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff}
</STYLE>
<title>培训考试系统考试页面 </title>
<link href="/agt/public/css/gb.css" rel="stylesheet" type="text/css">
<script LANGUAGE="JAVASCRIPT">

var time = <%=examTime%>;
var time_total = time * 60;
//var time_start = new Date();
//var clock_start = time_start.getTime();
var clock_start = <%=startTime%>;
var dl_ok=false;


function get_time_spent ()
{ 
    var time_now = new Date();
    return((time_now.getTime() - clock_start)/1000); 
}


function show_secs () // show the time user spent on the side
{ 
    var i_total_secs = Math.round(get_time_spent()); 

    var i_secs_spent = i_total_secs % 60;

    var i_mins_spent = Math.round((i_total_secs-30)/60); 

    var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
    var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);

    if(time != 0)
    { 
        if (time_total - i_total_secs == 600) alert ("考试还剩下10分钟了!!!");
        if (time_total == i_total_secs) document.onexamform.submit();
    }

    document.onexamform.timeLong.value = s_mins_spent + ":" + s_secs_spent;

    window.setTimeout('show_secs()',1000); 
}

</script>

<body bgcolor="B7D5F9" leftmargin="0" topmargin="00" marginwidth="0" marginheight="0" onLoad=" window.setTimeout('show_secs()',1);" onbeforeunload="forceSubmitPaper();" oncontextmenu=return(false); onselectstart="return false"  onbeforeprint="document.body.style.display = 'none';" >
    <table width="550" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td><p align="left"><font color="#FF0000" face="宋体"><br>
                          考试之前请阅读下面的事项</font></p></td>
        </tr>
    </table>


    <form name="onexamform" method="POST" action="/OnlineExam.do">

    <input type="hidden" name="opeType" value="<%=OperatorFlagCode.ONLINEEXAM_RANK_DEAL%>">

    <table width="550" border="0" cellpadding="3" cellspacing="1" class="table-cs1" align="center">
        <input type="hidden" name="byClass" value="1">
        <%if(maxCountStr == null || maxCount== 0)
        {
        %>
        <tr>
            <td height="25" align="center" class="td-cs1">这份试卷没有限制考试次数,你已经考了 <font color="#FF0000"><%=userCountStr%></font> 次。 </td>
        </tr>
        <%}
        else
        {%>
        <tr>
            <td height="25"  align="center" class="td-cs1">这份试卷你最多有 <font color="#FF0000"><%=maxCountStr%></font> 次考试机会,你已经考了 <font color="#FF0000"><%=userCountStr%></font> 次,还剩下 <font color="#FF0000"><%=leaveCount%></font> 次。</td>
        </tr>
        <%}%>
        <tr>
        <%
        if(examTimeStr == null || "0".equalsIgnoreCase(examTimeStr))
        {%>
            <td height="25"  align="center" class="td-cs1">这份试卷没有限制考试时间,关闭该窗口试卷被自动提交。</td>
        <%}
        else
        {%>
            <td  align="center" class="td-cs1">考试时间是 <font color="#FF0000"><%=examTimeStr%></font> 分钟,如果考试超时与关闭该窗口,试卷被自动提交。
            </td>
        <%}%>
        </tr>
        
        <tr>
            <td height="25" align="center" class="td-cs1">试卷名称:<%=titleStr%></td>
        </tr>
    </table>

    <table width="550" border="0" cellpadding="3" cellspacing="1" class="table-cs1" align="center">
    <%
    ArrayList alTestId = (ArrayList)session.getAttribute("alTestId");
    ArrayList alContent = (ArrayList)session.getAttribute("alContent");
    ArrayList alExplain = (ArrayList)session.getAttribute("alExplain");
    ArrayList alClassId = (ArrayList)session.getAttribute("alClassId");
    ArrayList alTestType = (ArrayList)session.getAttribute("alTestType");
    ArrayList alTypeName = (ArrayList)session.getAttribute("alTypeName");
    ArrayList alDegree = (ArrayList)session.getAttribute("alDegree");
    ArrayList alDegreeName = (ArrayList)session.getAttribute("alDegreeName");
    ArrayList alScore = (ArrayList)session.getAttribute("alScore");
    ArrayList alTestOption = (ArrayList)session.getAttribute("alTestOption");
    ArrayList alResult = (ArrayList)session.getAttribute("alResult");
    ArrayList alUserLevel = (ArrayList)session.getAttribute("alUserLevel");
    ArrayList alUseFrequency = (ArrayList)session.getAttribute("alUseFrequency");
    ArrayList alReferenceTime = (ArrayList)session.getAttribute("alReferenceTime");
    
    ArrayList alReply = (ArrayList)session.getAttribute("alReply");
    
    int testItemCount = ((Integer)session.getAttribute("testItemCount")).intValue();  
    int testItemNum = Integer.parseInt(Initor.systemConfig.get("agt/testItemNum","2"));
    
    int pageNo = Integer.parseInt(request.getParameter("pageNo"));
    int startLocate = 0;
    
    String optionRsSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    
    //获取上个页面的数据,把它们放到session里面去
    String[] replayArr = request.getParameterValues("reply");
    if(pageNo > 1)
    {
        for(int i = 0; i < replayArr.length; i++)
        {
            alReply.add(replayArr[i]);
        }
    }
    
    if((pageNo>0)&&(testItemNum>0))
    {
        startLocate = (pageNo-1)*testItemNum;
    }
    
    int pageCount = 1;
    if(0!=testItemNum)
    {
        pageCount = testItemCount/testItemNum;
        
        if(0!=(testItemCount%testItemNum))
        {
            pageCount++;
        }
    }
    
    for(int i = 0; i < testItemNum; i++)
    {
        if(startLocate>=testItemCount)
        {
            break;
        }
        //4:试题类型 5:试题类型名称,1:试题内容,9:试题选项,8:试题分数,10:试题答案
    %>
        <tr>
            <td width="20%" align="center" valign="top" class="td-cs2" ><%=alTypeName.get(startLocate)%></td>
                <input type="hidden" name="testIds" value="<%=alTestId.get(startLocate)%>">
                <input type="hidden" name="testType" value="<%=alTestType.get(startLocate)%>">
                <input type="hidden" name="score" value="<%=alScore.get(startLocate)%>">
                <input type="hidden" name="reply" value="">
                <input type="hidden" name="result" value="<%if(("1".equals(((String)alTestType.get(startLocate)).trim())) || ("2".equals(((String)alTestType.get(startLocate)).trim())) || ("3".equals(((String)alTestType.get(startLocate)).trim()))){%><%=alResult.get(startLocate)%><%}%>">              
            <td valign="top" class="td-cs2" style="word-break:break-all">&nbsp;<%=alContent.get(startLocate)%>&nbsp;(<%=alScore.get(startLocate)%>分)
                <table border="0" cellpadding="3" cellspacing="0">
 
<%
                //对试题选项进行处理
                int testType = Integer.parseInt((String)alTestType.get(startLocate));
                int loc = 0;

                StringTokenizer stoken = new StringTokenizer((String)alTestOption.get(startLocate),"#");
 
                while(stoken.hasMoreTokens())
                {
                

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -