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

📄 kaoshi.asp

📁 是一个电子商务网站的功能介绍
💻 ASP
📖 第 1 页 / 共 4 页
字号:
<!--#include file="conn.asp"-->
 <%
  if session("username")="" then
  response.redirect "relogin.asp"
  end if
  
  function HTMLEncode(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	fString = Replace(fString, " ", "&nbsp;")
	HTMLEncode = fString
end function
  
username=request.cookies("username")
paperno=request("paperno")

%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>开始考试</title>
 
<script language="javascript">
<!--
float_init	= 1;
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; }
}

function switchSysBar1(){
if (switchPoint1.innerText=="计时器:"){
switchPoint1.innerText="计时器"
document.all("AutoNumber2").style.display="none"
}else{
switchPoint1.innerText="计时器:"
document.all("AutoNumber2").style.display=""
}}
//-->
</script>   
<link rel="stylesheet" type="text/css" href="css.css">
</head>


<%
sqltest="SELECT  * from tbscore  where username='"&username&"'   and paperno="&paperno
set rstest=server.createobject("adodb.recordset")
rstest.open sqltest,conn,3,2

if rstest("isexam")=1 then
  response.redirect "ks_selecttype.asp?paperno="&paperno
else


 sqlt="SELECT * from tbpaper  where   paperno="&paperno
set rst=server.createobject("adodb.recordset")
rst.open sqlt,conn,3,2

kcid=rst("kcid")


   

 sqlkc="SELECT * from tbkc  where  kcid="&kcid
set rskc=server.createobject("adodb.recordset")
rskc.open sqlkc,conn,3,2

 dt=date+time
 
 if rstest("num")=0 then
    rstest("num")=1
    rstest("logintime")=dt
    rstest.update
 else
  rstest("num")=1+rstest("num")
  rstest.update
 end if
		if dt<rst("stime")  then 
		  %><center><h3><font color=red>考试时间没有到</font></h3></center><%
		else
			if dt>rst("etime") then 
			
sqlc="SELECT  * from tbscore  where username='"&username&"'   and paperno="&paperno
set rsc=server.createobject("adodb.recordset")
rsc.open sqlc,conn,3,2

   rsc("isexam")=1 
    rsc.update
	   		 %><center><h3><font color=red>试卷已经提交,考试时间已经过了</font></h3></center><%
   			 else



sql0="SELECT tbuser.username, tbnianji.nianji, tbbanji.banji, tbpower.power FROM tbuser INNER JOIN ((tbpower INNER JOIN tbbanji ON tbpower.banjiid = tbbanji.banjiid) INNER JOIN tbnianji ON tbpower.nianjiid = tbnianji.nianjiid) ON (tbuser.banji = tbbanji.banji) AND (tbuser.nianji = tbnianji.nianji) WHERE (((tbuser.username)='"&username&"'));"
set rs0=server.createobject("adodb.recordset")
rs0.open sql0,conn,3,2
a=rs0("power")


flag=0

if instr(a,",")>0 then 
a=split(a,",")
u=ubound(a)
	
	for w=0 to u

	if cint(paperno)=cint(a(w)) then 
 
	flag=1
	
	end if 
	next
else
	if paperno=a then 
	flag=1
	end if 
end if 

if flag=0 then 
 

response.write  "<center><h2>您没有权限</h2></center>" 
else
	
sqltest1="SELECT  * from tbscore  where username='"&username&"'   and paperno="&paperno
set rstest1=server.createobject("adodb.recordset")
rstest1.open sqltest1,conn,3,2

lasttime=rstest1("lasttime")
stime=timevalue(rstest1("logintime"))
etime=dateadd("n",rstest1("lasttime"),rstest1("logintime"))


	if etime>rst("etime")  then
	etime1=rst("etime")
	etime=timevalue(rst("etime"))
	else
	etime1=dateadd("n",rstest1("lasttime"),rstest1("logintime"))
	etime=timevalue(etime)
	end if
	
stime1=rstest1("logintime")
 
 if rstest("num")=1 then
    rstest("gotime")=etime
    rstest.update
 end if

	%><form name="testform"  method="POST"   ><h3 align="center">
    <font color="#0000FF">您现在正在参加<%=rskc("kcm")%>考试</font></h3> 
     <center>考试时间<%=rstest1("lasttime")%>分钟&nbsp;&nbsp;&nbsp;<%=stime%>&nbsp;到&nbsp;<%=etime%>&nbsp;&nbsp;&nbsp;出卷人:<%=rst("adminname")%></center>
	<%
	'-------------------------名词解释
	
	     Set rsno1=Server.CreateObject("Adodb.RecordSet")
    sqlno1="select * from tbkcconfig where kcid="&kcid&" and category=1 and paperno="&paperno
   rsno1.open sqlno1,conn,1,3
	
if  rsno1("datano")<>0 then	
   sqlmc="SELECT top "&rsno1("datano")&" tbtk.tmid, tbtk.title,tbtk.category, tbkc.kcid, tbkc.kcm, tbtk.chapter,tbtk.level,photo  FROM tbkc, userdata , tbtk  WHERE username='"&username&"' and userdata.tmid=tbtk.tmid and tbtk.kcid=tbkc.kcid and tbkc.kcid="&kcid&" and tbtk.kao=1   and category=1 and userdata.paperno="&paperno&" order by tbtk.tmid;"

    set rsmc=server.createobject("adodb.recordset")
    rsmc.open sqlmc,conn,3,2
    
if not rsmc.eof then
    
    
%><table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="100%" height="64">
  <tr  class="trh">
      <td width="32" align="center" bgcolor="#799AE1" height="22">
      <font color="#FFFFFF"><b>序号</b></font></td>
      <td align="center" bgcolor="#799AE1" width="604" height="22">
      <p align="center"><font color="#FFFFFF"><b>名词解释<span lang="en-us">(</span>共<%=rsno1("datano")%>题<span lang="en-us">,<%=rsno1("datano")*rsno1("datavalue")%></span>分<span lang="en-us">)</span></b></font></td>
    </tr>
    <% 
    imc=1
    For mcno = 1 To rsno1("datano")
    
	textmc1="textmc"&cstr(rsmc("tmid"))

  if Request.ServerVariables("http_method")="POST" then
     sqlmc2="SELECT * FROM  userdata where username='"&username&"' and  tmid="&rsmc("tmid")&"and paperno="&paperno
   set rsmc2=server.createobject("adodb.recordset")
   rsmc2.open sqlmc2,conn,3,2
  
 
   textmc2=request(""&textmc1&"")

  rsmc2("uans")=cstr(trim(textmc2))
  rsmc2.update 
  rsmc2.close
  end if   


     sqlmc3="SELECT * FROM  userdata where username='"&username&"' and  tmid="&rsmc("tmid")&"and paperno="&paperno
   set rsmc3=server.createobject("adodb.recordset")
   rsmc3.open sqlmc3,conn,3,2
%>
  <tr class="trh1">
      <td align="center" height="1" width="32"><%=imc%></td>
      <td align="left" width="604" height="1"> &nbsp;  &nbsp; &nbsp; <%=rsmc("title")%>——(难度:<%
    if  rsmc("level")=1  then 
    response.write "容易"
    end if 
     if  rsmc("level")=2 then 
    response.write "中等"
    end if 
      
      if  rsmc("level")=3 then 
    response.write "较难"
    end if  
       if  rsmc("level")=4  then 
    response.write "最难"
    end if 
      %>) <br><% if len(rsmc("photo")) > 1 then
            %> <center><br>
   
      <img border="0" src="examimage/<%=rsmc("photo")%>"> 
      </center> 
        
       <% end if %><br>答: <input type="text" name="<%=textmc1%>" size="80" value="<%=rsmc3("uans")%>" onblur="this.className='inputnormalleft'" onfocus="this.className='inputedit';this.select()" class="inputnormalleft"><br> <br> </td>
    </tr>
     <% 
     

⌨️ 快捷键说明

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