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

📄 paper.asp

📁 网络考试系统最终备份
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="conn.inc"-->
<html>
<head>
<title>网络在线考试</title>
<link rel="stylesheet" type="text/css" href="css.css">
<style>
<!--
.outborder   { border-left: 1px solid #333333; border-right: 1px solid #000000; 
               border-top: 1px solid #99CCFF; border-bottom: 1px solid #000000; 
               background-color: #336699 }
.inputborder { color: #00FF00; text-align: center; border-style: solid; border-width: 1; 
               background-color: #333333 }
-->
</style>
<script language="javascript">
<!--
float_init	= 1;

function troublesave(Qid)
{
	  var key = "NO"+Qid; 
	  var stuKey = ""  
	  var  length = testform.elements[key].length;
      for (var i = 0 ;i < length;i++)
     {
       var v=""
      if(testform.elements[key][i].checked)
	  {
	         	 stuKey = stuKey + testform.elements[key][i].value+","; // 单选多选
	  }
     
     }
      qlength = stuKey.lastIndexOf(",");
	  
	  var qkey =stuKey.substr(0,qlength);
	  //alert(Qid);
	  parent.topFrame.location="SaveExamTrouble.asp?QueID="+Qid+"&stukey="+qkey;
 

}
function DHTML_Init(Object) { 
  if (navigator.userAgent.match(/Mozilla\/5\../) && float_init) { 
 	 SetObjectOffsetTop(Object, undefined);
  } 
}
function All (ID) { 
  if (document.all)	{  return document.all[ID];   } 
  else if (document.documentElement){
  return document.getElementById (ID); 
  } 
  else if (document.layers)	{ return document.layers[ID]; }
}
function GetWindowOffsetTop() {
  if (window.innerHeight)	{ return window.pageYOffset; }
  else if (document.body)	{ return document.body.scrollTop; }
} 
function GetWindowHeight() { 
  if (window.innerHeight)	{ return window.innerHeight; } 
  else if (document.body)	{ return document.body.clientHeight; }} 
function GetObjectHeight(Object) {
  DHTML_Init(Object);
  if (document.all || document.documentElement)	{
    Clip = Object.style.clip; 
  if (! Clip) { return Object.offsetHeight; }
  else	{ return GetClipElement (Clip, 'Bottom'); }} 
  else if (document.layers)	{ return Object.clip.height; }} 
function GetClipElement (Clip, Element) {
  Clip = Clip.substr(Clip.indexOf('(') + 1); 
  Clip = Clip.substr(0, Clip.length - 1);
  Clippers = Clip.split (" "); 
  for (i = 0; i < Clippers.length; i++) { 
    if (Clippers[i] != 'auto') {
    Clippers[i] = Clippers[i].replace (/D/g, ""); }
  } 
  ClipTop = Number(Clippers[0]); 
  ClipRight = Number(Clippers[1]); 
  ClipBottom = Number(Clippers[2]);
  ClipLeft = Number(Clippers[3]); 
  if (Element == 'Top')		{ return ClipTop; } 
    else if (Element == 'Right')	{ return ClipRight; } 
    else if (Element == 'Bottom')	{ return ClipBottom; } 
    else if (Element == 'Left')	{ return ClipLeft; } 
    else				{ return undefined; }} 
function GetObjectOffsetTop(Object) { 
  DHTML_Init(Object); 
  if (Object.offsetTop)	{ return Object.offsetTop; } 
  else if (document.layers)	{ return Object.top; }
} 
function SetObjectOffsetTop(Object, Offset) { 
  if (Object.style)	{ Object.style.top = Offset; } 
  else if (Object.top)	{ Object.top = Offset; }} 
  CenterMenu = 1;	 
  MenuBorder = 100; 
  TimeCheck  = 250;	 
  TimeUpdate = 15; 
  DivUpdate  = 15;	 
  Minimum    = 50;	 
  AddHeight  = -4; 
function ScrollMenu() { 
  Menu		= All('persistMenu'); 
  WinTop	= GetWindowOffsetTop(); 
  WinHeight	= GetWindowHeight() + AddHeight;
  MenuTop	= GetObjectOffsetTop(Menu); 
  MenuHeight = GetObjectHeight (Menu); 
  MenuNew	= (CenterMenu) ? Math.round (WinTop + (WinHeight - MenuHeight) / 1) : WinTop + MenuBorder; 
  if (MenuNew < Minimum) 
  { MenuNew = Minimum; }
  if (MenuTop != MenuNew) { 
  if ( (MenuTop + MenuHeight) < WinTop || MenuTop > (WinTop + WinHeight) ) { 
    SetObjectOffsetTop (Menu, (MenuTop < MenuNew) ? (WinTop - MenuHeight) : (WinTop + WinHeight)); 
  }
  else { 
     Add = (MenuTop < MenuNew) ? 1 : -1; 
     SetObjectOffsetTop (Menu, MenuTop + Math.round((MenuNew - MenuTop) / DivUpdate) + Add); 
     } 
     } 
         window.setTimeout('ScrollMenu()', (GetObjectOffsetTop(Menu) == MenuNew) ? TimeCheck : TimeUpdate); 
     }

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%

v_PaperID = session("test")

if request("downloadok")<>"y" then
sql="select * from paper_info where PaperID="&v_PaperID
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
v_subID=rs("Sub_ID")
v_paperName = rs("PaperName")
singlecount=rs("singlecount")
singleper=rs("singleper")
multicount=rs("multicount")
multiper=rs("multiper")
judgecount=rs("judgecount")
judgeper=rs("judgeper")
starttime=rs("StartTime")
st = rs("StartTime")
endtime=rs("EndTime")

rs.close
set rs=nothing

if now > endtime then
Response.Write("<script>alert(""考试时间已经结束,剥夺考试资格!"");location.href=""exam_online.asp"";</script>")
end if

if  now <starttime   then 
Response.Write("<script>alert(""考试时间未到,请等候!"");location.href=""exam_online.asp"";</script>")
end if


if  dateDiff("h", starttime, endtime) > 0 then
testtime = dateDiff("h", starttime, endtime)
else
testtime = dateDiff("h",endtime ,starttime )
end if
stArr = split (starttime,":")
stmm = stArr(1)
stss = stArr(2)
stmm =cint(stmm)
stss = cint(stss)
endArr = split (endtime,":")
endmm = endArr(1)
endss = endArr(2)
endmm=cint(endmm)
endss = cint(endss)
testm = endmm - stmm
tests = endss - stss




'已经开考时间
'小时
htime =  dateDiff("h", starttime, now)

stArr = split (starttime,":")
stmm = stArr(1)
stss = stArr(2)
stmm =cint(stmm)
stss = cint(stss)
nowArr = split (now,":")
nowmm = nowArr(1)
nowss = nowArr(2)
nowmm=cint(nowmm)
nowss = cint(nowss)
'分
htestm = nowmm - stmm
if htestm <= 0 then
htestm = stmm - nowmm
end if
'秒
htests = nowss - stss
if htests<=0 then
htests = stss - nowss
end if


testtime = testtime  - htime
testm = testm - htestm
tests = tests - htests

sql="select * from test_user where Paper_ID="&v_PaperID& " and User_ID="&request.Cookies("userid")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
rs("isTest")= -1
rs.update
rs.close


sql = "select * from subject_info where SubID ="&v_subID
SET rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,3,2
subject=rs("SubName")
rs.close
set rs = nothing
%>
<p align="center"><b><font face="黑体" size="5" color="#FF0000">网上在线《<%=subject%>--<%=v_paperName%>》考试</font></b></p>
<form method="POST" action="createresult.asp" onSubmit="return submitit();" name="testform">
  <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
      <td width="100%" height="25"><b><font size="3" color="#000080">一、单项选择题(每题<%=singleper%>分,共<%=singlecount%>题)
        
            </font></b></td>
    </tr>
  </table>
  <%
sql1="select * from paper_detail where DQue_Type=0 and Paper_ID="&v_PaperID&""
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,3,2
sNoumber = 1
ri = 0
while not rs1.eof
tempQue_ID=rs1("Que_ID")

sql="select * from question_database where QueID="&tempQue_ID&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
%>
  <table border="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0" width="100%" id="AutoNumber2" cellpadding="0">
    <tr>
      <td width="100%" bgcolor="#EFEFEF" height="20">&nbsp;&nbsp;<b><%=sNoumber%>、<%=rs("Question")%>
        <input name="Que_ID" type="hidden" id="Que_ID" value="<%=rs("QueID")%>">
      </b></td>
    </tr>
    <%
  if rs("Option1")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="A" onClick="troublesave(<%=rs("QueID")%>);" 
		  <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then
		  if instr(ucase(rst("StuAnswer")),"A")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close
		  set rst = nothing
		  %>  >
          A、<%=rs("Option1")%></td>
    </tr>
    <%
  end if
  %>
    <%
  if rs("Option2")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="B"  onClick="troublesave(<%=rs("QueID")%>);"
		    <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then
		  if  instr(ucase(rst("StuAnswer")),"B")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close
		  set rst = nothing
		  %>  >
          B、<%=rs("Option2")%></td>
    </tr>
    <%
  end if
  %>
    <%
  if rs("Option3")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="C"  onClick="troublesave(<%=rs("QueID")%>);"
		    <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then
		  if instr(ucase(rst("StuAnswer")),"C")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close
		  set rst = nothing
		  %>  >
          C、<%=rs("Option3")%></td>
    </tr>
    <%
  end if
  %>
    <%
  if rs("Option4")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="D"  onClick="troublesave(<%=rs("QueID")%>);"
		    <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then
		  if  instr(ucase(rst("StuAnswer")),"D")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close
		  set rst = nothing
		  %>  >
          D、<%=rs("Option4")%></td>
    </tr>
    <%
  end if
  %>
    <%
  if rs("Option5")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="E"  onClick="troublesave(<%=rs("QueID")%>);"
		    <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then
		  if  instr(ucase(rst("StuAnswer")),"E")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close
		  set rst = nothing
		  %>  >
          E、<%=rs("Option5")%></td>
    </tr>
    <%
  end if
  %>
    <%
  if rs("Option6")<>"" then
  
  %>
    <tr>
      <td width="100%">&nbsp;&nbsp;&nbsp;&nbsp;
          <input type="radio" name="NO<%=rs("QueID")%>" value="F"  onClick="troublesave(<%=rs("QueID")%>);"
		    <%
		  sqlt = "select * from trouble_restore where Paper_ID = "&v_PaperID&" and Que_ID = "&tempQue_ID&" and User_ID="&request.Cookies("userid")
		  set rst = server.CreateObject("adodb.recordset")
		  rst.open sqlt,conn,3,2
		 
		  if not rst.eof then 
		  if  instr(ucase(rst("StuAnswer")),"F")<>0 then
	
		  %>checked
		  <%
		  end if
		  end if
		  rst.close

⌨️ 快捷键说明

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