首页

jsp 在线考试系统源码(含数据库 sqlserver)

java

2020-7-9

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*" errorPage="" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<jsp:useBean id="lesson" class="com.wgh.dao.TaoTiDAO" scope="page"/>
<%
int lessonID=Integer.parseInt((String)session.getAttribute("lessonID"));
List list_s=(List)request.getAttribute("singleQue");
int s=40/list_s.size();
List list_m=(List)request.getAttribute("moreQue");
int m=60/list_m.size();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>网络在线考试</title>
<link rel="stylesheet" href="../CSS/style.css"/>
<script language="javascript" src="../JS/AjaxRequest.js">
</script>
<script language="javascript">
timer = window.setInterval("showStartTime();showRemainTime();",1000); 
//此处需要加&nocache=" new Date().getTime(),否则将出现时间不自动走动的情况
function showStartTime(){
	var loader=new net.AjaxRequest("startExam.do?action=showStartTime&nocache=" new Date().getTime(),deal_s,onerror,"GET");
}
function showRemainTime(){
	var loader1=new net.AjaxRequest("startExam.do?action=showRemainTime&nocache=" new Date().getTime(),deal_r,onerror,"GET");
}
function onerror(){
window.open('../index.jsp','','toolbar,menubar,scrollbars,resizable,status,location,directories,copyhistory,height=600,width=778');
window.close();
}
function deal_s(){
	showStartTimediv.innerHTML=this.req.responseText;
}
function deal_r(){
	showRemainTimediv.innerHTML=this.req.responseText;
	if(this.req.responseText=="00:00:00"){
		questionsForm.submit.click();
	}
}
</script>
<script language=javascript>
function keydown(){
	if(event.keyCode==8){
		event.keyCode=0;
		event.returnValue=false;
		alert("当前设置不允许使用退格键");
	  }if(event.keyCode==13){
		event.keyCode=0;
		event.returnValue=false;
		alert("当前设置不允许使用回车键");
	  }if(event.keyCode==116){
		event.keyCode=0;
		event.returnValue=false;
		alert("当前设置不允许使用F5刷新键");
	  }if((event.altKey)&&((window.event.keyCode==37)||(window.event.keyCode==39))){
		event.returnValue=false;
		alert("当前设置不允许使用Alt 方向键←或方向键→");
	  }if((event.ctrlKey)&&(event.keyCode==78)){
	   event.returnValue=false;
	   alert("当前设置不允许使用Ctrl n新建IE窗口");
	  }if((event.shiftKey)&&(event.keyCode==121)){
	   event.returnValue=false;
	   alert("当前设置不允许使用shift F10");
	  }
}
function click() {
 event.returnValue=false;
	 alert("当前设置不允许使用右键!");
}
document.oncontextmenu=click;
</script>

</head>

<body onLoad="showStartTime();showRemainTime();" onkeydown="keydown()">
<table width="770" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="40" height="39" background="../Images/startExam_leftTop.jpg">&nbsp;</td>
    <td width="667" align="right" background="../Images/startExam_top.jpg">&nbsp;
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>	
<td width="23%" nowrap height=23 align=right>考试时间:</td>
		<td width="14%" nowrap><font color="#FF0000">20</font>分钟</td>
		<td width="13%" nowrap>计 时:</td>
		<td width="60" nowrap><div id="showStartTimediv">00:00:00</div>
		</td>
		<td width="16%" nowrap>剩余时间:</td>
		<td width="60" align=left nowrap><div id="showRemainTimediv"></div></td></tr>
</table>	
	</td>
    <td width="19" background="../Images/startExam_top.jpg">&nbsp;</td>
    <td width="44" background="../Images/startExam_rightTop.jpg">&nbsp;</td>
  </tr>
  <tr>
    <td height="435" rowspan="2" background="../Images/startExam_left.jpg">&nbsp;</td>
    <td height="43" colspan="2"><img src="../Images/startExam_ico.jpg" width="117" height="43"></td>
    <td rowspan="2" background="Images/startExam_right.jpg">&nbsp;</td>
  </tr>
  <tr>
    <td height="600" colspan="2" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="2" align="center" class="title"><%=lesson.getLesson(lessonID)%> &nbsp;&nbsp;考试卷
          </td>
        </tr>
        <tr>
          <td width="64%">&nbsp;</td>
          <td width="36%">&nbsp;满分<font color="red">100</font>分&nbsp;&nbsp;&nbsp;单选题<font color="red">40</font>分&nbsp;&nbsp;&nbsp;多选题<font color="red">60</font>分</td>
        </tr>
      </table>
	  <html:form action="/manage/startExam.do?action=submitTestPaper" method="post">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
	    <td>
<table id="single" width="90%"  border="0" cellspacing="0" cellpadding="0" align=center>

  <tr>
    <td colspan="4" height=23 style="font-size:11pt;">一、单选题(<font color=red>每题<%=s %>分,答错不得分</font>)</td>
  </tr>
<logic:iterate id="questions" name="singleQue" type="com.wgh.actionForm.QuestionsForm" scope="request" indexId="ind">
  <tr>
    <td height=23 colspan="4" align=center nowrap>
	  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="8%" align=right height=23>[&nbsp;${ind 1}&nbsp;]</td>
		  <td width="2%">&nbsp;</td>
		  <td width="90%" align=left nowrap style="font-size:11pt;"><bean:write name="questions" property="subject" filter="true"/>
		  <html:hidden property="idArrS[${ind}]" name="questions"/>
		  </td>
        </tr>
      </table>
	</td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="A"/></td>
    <td width="3%" align=center nowrap>A.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionA" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="B"/></td>
    <td width="3%" align=center nowrap>B.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionB" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="C"/></td>
    <td width="3%" align=center nowrap>C.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionC" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="D"/></td>
    <td width="3%" align=center nowrap>D.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionD" filter="true"/></td>
  </tr>
  </logic:iterate>
</table>

<table id="single" width="90%"  border="0" cellspacing="0" cellpadding="0" align=center>

  <tr>
    <td colspan="4" height=23 style="font-size:11pt;">二、多选题(<font color=red>每题<%=m%>分,答错不得分</font>)</td>
  </tr>
<logic:iterate id="questions" name="moreQue" type="com.wgh.actionForm.QuestionsForm" scope="request" indexId="ind">
  <tr>
    <td height=23 colspan="4" align=center nowrap>
	  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="8%" align=right height=23>[&nbsp;${ind 1}&nbsp;]</td>
		  <td width="2%">&nbsp;</td>
		  <td width="90%" align=left nowrap style="font-size:11pt;"><bean:write name="questions" property="subject" filter="true"/>
		  <html:hidden property="idArrM[${ind}]" name="questions"/>
		  </td>
        </tr>
      </table>
	</td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="A"/></td>
    <td width="3%" align=center nowrap>A.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionA" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="B"/></td>
    <td width="3%" align=center nowrap>B.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionB" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="C"/></td>
    <td width="3%" align=center nowrap>C.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionC" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="D"/></td>
    <td width="3%" align=center nowrap>D.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionD" filter="true"/></td>
  </tr>
  </logic:iterate>
</table>		
		</td>
	  </tr>
        <tr>
		  <td align="center"><html:submit property="submit" styleClass="btn_grey" value="交卷"/>		  </td>
        </tr>
      </table>
	  </html:form>
	  </td>
  </tr>
  <tr>
    <td width="40" height="40" background="../Images/startExam_leftBottom.jpg">&nbsp;</td>
    <td colspan="2" background="../Images/startExam_bottom.jpg">&nbsp;</td>
    <td background="../Images/startExam_rightBottom.jpg">&nbsp;</td>
  </tr>
</table>
</body>
</html>

资源下载此资源下载价格为3D币(VIP免费),请先
资源文件列表
08/copyright.jsp , 793
08/CSS/style.css , 1979
08/Database/db_netExam_Data.MDF , 1835008
08/Database/db_netExam_Log.LDF , 2883584
08/dealNull.jsp , 488
08/default.jsp , 1257
08/error.jsp , 868
08/examRule.jsp , 2538
08/Images/add.gif , 587
08/Images/bg_01.gif , 49
08/Images/default_bottom.JPG , 115145
08/Images/default_mid.JPG , 227556
08/Images/default_top.jpg , 105753
08/Images/error.jpg , 19902
08/Images/f_ico.gif , 173
08/Images/login_bottom.jpg , 78893
08/Images/login_mid.jpg , 52384
08/Images/login_top.jpg , 102349
08/Images/m_ico.gif , 65
08/Images/m_ico1.gif , 59
08/Images/m_login.jpg , 76626
08/Images/m_top.jpg , 89527
08/Images/seedPwd.gif , 3069
08/Images/startExam_bottom.jpg , 13360
08/Images/startExam_ico.jpg , 18469
08/Images/startExam_left.jpg , 13318
08/Images/startExam_leftBottom.jpg , 14295
08/Images/startExam_leftTop.jpg , 14310
08/Images/startExam_right.jpg , 13322
08/Images/startExam_rightBottom.jpg , 14395
08/Images/startExam_rightTop.jpg , 14406
08/Images/startExam_top.jpg , 13357
08/Images/step1.gif , 1090
08/Images/step2.gif , 1122
08/Images/step3.gif , 1134
08/Images/subBG.jpg , 32722
08/Images/Thumbs.db , 92160
08/Images/top_bg.jpg , 97376
08/index.jsp , 3285
08/JS/AjaxRequest.js , 1276
08/JS/function.js , 2486
08/JS/onclock.JS , 720
08/logout.jsp , 386
08/manage/copyright.jsp , 793
08/manage/error.jsp , 862
08/manage/left.jsp , 2901
08/manage/lesson.jsp , 4000
08/manage/lesson_add.jsp , 2288
08/manage/lesson_ok.jsp , 648
08/manage/login.jsp , 2225
08/manage/logout.jsp , 389
08/manage/main.jsp , 3224
08/manage/manager.jsp , 2651
08/manage/manager_add.jsp , 2924
08/manage/manager_ok.jsp , 654
08/manage/pwd_Modify.jsp , 4060
08/manage/pwd_ok.jsp , 381
08/manage/questions.jsp , 4610
08/manage/questions_Add.jsp , 5857
08/manage/questions_Modify.jsp , 6372
08/manage/questions_ok.jsp , 837
08/manage/selTaoTi.jsp , 306
08/manage/student.jsp , 4121
08/manage/student_ok.jsp , 379
08/manage/taoTi.jsp , 4285
08/manage/taoTi_Add.jsp , 2876
08/manage/taoTi_Modify.jsp , 2984
08/manage/taoTi_ok.jsp , 813
08/manage/top.jsp , 408
08/noenLesson.jsp , 391
08/prompt.jsp , 2294
08/readme.doc , 886272
08/ready.jsp , 2307
08/register.jsp , 4900
08/seekPwd.jsp , 3141
08/seekPwd1.jsp , 3348
08/seekPwd2.jsp , 2858
08/selectLesson.jsp , 2426
08/showRemainTime.jsp , 84
08/showStartTime.jsp , 98
08/src/com/connDB.properties , 472
08/src/com/wgh/action/Lesson.java , 3538
08/src/com/wgh/action/Manager.java , 4167
08/src/com/wgh/action/Questions.java , 4537
08/src/com/wgh/action/SelfRequestProcessor.java , 531
08/src/com/wgh/action/StartExam.java , 6941
08/src/com/wgh/action/Student.java , 5545
08/src/com/wgh/action/StuResult.java , 1819
08/src/com/wgh/action/TaoTi.java , 3858
08/src/com/wgh/action/temp.java , 760
08/src/com/wgh/actionForm/LessonForm.java , 870
08/src/com/wgh/actionForm/ManagerForm.java , 682
08/src/com/wgh/actionForm/MoreSelect.java , 246
08/src/com/wgh/actionForm/QueryResultIfForm.java , 419
08/src/com/wgh/actionForm/QuestionsForm.java , 3706
08/src/com/wgh/actionForm/StudentForm.java , 2164
08/src/com/wgh/actionForm/StuResultForm.java , 1338
08/src/com/wgh/actionForm/TaoTiForm.java , 1079
08/src/com/wgh/core/ChStr.java , 1056
08/src/com/wgh/core/ConnDB.java , 3436
08/src/com/wgh/dao/LessonDAO.java , 4199
08/src/com/wgh/dao/ManagerDAO.java , 3461
08/src/com/wgh/dao/QuestionsDAO.java , 5701
08/src/com/wgh/dao/StartExamDAO.java , 4632
08/src/com/wgh/dao/StudentDAO.java , 7506
08/src/com/wgh/dao/StuResultDAO.java , 2647
08/src/com/wgh/dao/TaoTiDAO.java , 4055
08/src/com/wgh/struts/ApplicationResources.properties , 83
08/startExam.jsp , 9686
08/studentM_ok.jsp , 363
08/student_Modify.jsp , 5765
08/student_ok.jsp , 376
08/stuResultQuery.jsp , 2894
08/submitTestPaperok.jsp , 502
08/top.jsp , 374
08/WEB-INF/.struts-config.mex , 23970
08/WEB-INF/classes/com/connDB.properties , 472
08/WEB-INF/classes/com/wgh/action/Lesson.class , 3975
08/WEB-INF/classes/com/wgh/action/Manager.class , 4326
08/WEB-INF/classes/com/wgh/action/Questions.class , 4145
08/WEB-INF/classes/com/wgh/action/SelfRequestProcessor.class , 933
08/WEB-INF/classes/com/wgh/action/StartExam.class , 6982
08/WEB-INF/classes/com/wgh/action/Student.class , 5134
08/WEB-INF/classes/com/wgh/action/StuResult.class , 2535
08/WEB-INF/classes/com/wgh/action/TaoTi.class , 3882
08/WEB-INF/classes/com/wgh/action/temp.class , 1528
08/WEB-INF/classes/com/wgh/actionForm/LessonForm.class , 1320
08/WEB-INF/classes/com/wgh/actionForm/ManagerForm.class , 1125
08/WEB-INF/classes/com/wgh/actionForm/MoreSelect.class , 599
08/WEB-INF/classes/com/wgh/actionForm/QueryResultIfForm.class , 771
08/WEB-INF/classes/com/wgh/actionForm/QuestionsForm.class , 4814
08/WEB-INF/classes/com/wgh/actionForm/StudentForm.class , 2622
08/WEB-INF/classes/com/wgh/actionForm/StuResultForm.class , 1808
08/WEB-INF/classes/com/wgh/actionForm/TaoTiForm.class , 1720
08/WEB-INF/classes/com/wgh/core/ChStr.class , 1830
08/WEB-INF/classes/com/wgh/core/ConnDB.class , 3583
08/WEB-INF/classes/com/wgh/dao/LessonDAO.class , 4202
08/WEB-INF/classes/com/wgh/dao/ManagerDAO.class , 3590
08/WEB-INF/classes/com/wgh/dao/QuestionsDAO.class , 5893
08/WEB-INF/classes/com/wgh/dao/StartExamDAO.class , 5240
08/WEB-INF/classes/com/wgh/dao/StudentDAO.class , 6785
08/WEB-INF/classes/com/wgh/dao/StuResultDAO.class , 3089
08/WEB-INF/classes/com/wgh/dao/TaoTiDAO.class , 4346
08/WEB-INF/classes/com/wgh/struts/ApplicationResources.properties , 83
08/WEB-INF/struts-bean.tld , 8860
08/WEB-INF/struts-config.xml , 5824
08/WEB-INF/struts-html.tld , 73617
08/WEB-INF/struts-logic.tld , 14731
08/WEB-INF/struts-nested.tld , 71483
08/WEB-INF/struts-tiles.tld , 7842
08/WEB-INF/web.xml , 942
最多只能显示150条信息!
没有账号? 忘记密码?

社交账号快速登录