This Domain(Admin5.com) is for Sale:

利用ASP和Access数据库制作局域网网上答题系统

时间:2007-12-23  来源:不详  作者:迈克DB

<%s=Right(s,Len(s)-x 1)
x=InStr(s,"B.")%>'以下开始显示复选框及选择部分
<INPUTType=CheckBoxName=AValue="a">
<%=Left(s,x-1)%><BR>
<%s=Right(s,Len(s)-x 1)
x=InStr(s,"C.")%>
<INPUTType=CheckBoxName=AValue="b">
<%=Left(s,x-1)%><BR>
<%s=Right(s,Len(s)-x 1)
x=InStr(s,"D.")%>
<INPUTType=CheckBoxName=AValue="c">
<%=Left(s,x-1)%><BR>
<%s=Right(s,Len(s)-x 1)%>
<INPUTType=CheckBoxName=AValue="d"><%=s%>
<BR>
<INPUTType=SubmitValue="查看答案">
<ahref="lkzk."target="_self">继续做题</a><BR>
<%ifrsu2("nnn") rsu2("yyy")=0thenrsu2("yyy")=1endif%>
正确率:<%=FormatNumber(rsu2("yyy")/(rsu2("nnn") rsu2("yyy"))*100,2,True)%>%
总答题数:<%=rsu2("nnn") rsu2("yyy")%>
</form>
</font>
</BODY>
-----------------Save.-------------------
<!--#includevirtual="/lkzk/DB0.fun"--> 织梦好,好织梦
<%
Setrsu2=GetMdbStaticRecordset("lkzk.mdb","IP")
Setrs=GetMdbStaticRecordset("lkzk.mdb","题库")
%>
<HTML>
<BODY>
<%I=CInt(Request("AI"))
rs.AbsolutePosition=I 1
ssx="错"
A=Replace(Request("A"),",","")
ifA=rs("xz")then'判定答题正误
ssx="对"
endif
%>
<FONTColor=Red>
您答<%=ssx%>了'显示答案正误等信息
</FONT>
试题库总第<%=CStr(I 1 5)%>题您的答案是:<%=A%>
参考答案是:<%=rs("xz")%>
<%
ClientIP=Request.ServerVariables("REMOTE_ADDR")
userIP=Right(ClientIP,Len(ClientIP)-InStrRev(ClientIP,"."))
rsu2.AbsolutePosition=userIP
rsu2.Update
Ifssx="对"then
rsu2("yyy")=rsu2("yyy") 1
Endif
ifssx<>"对"then
rsu2("nnn")=rsu2("nnn") 1
Endif
rsu2.Update'以下将正误结果记录于表“IP”中
%>
</BODY>
</HTML>
--------------Db0.fun----------------
<%'以下为函数程序
'---------------------------------------------------

copyright dedecms


FunctionGetMdbConnection(FileName)
DimProvider,DBPath
Provider="Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath="DataSource="&Server.MapPath(FileName)
SetGetMdbConnection=GetConnection(Provider&DBPath)
EndFunction
'---------------------------------------------------
FunctionGetMdbRecordset(FileName,Source)
SetGetMdbRecordset=GetMdbRs(FileName,Source,2,"")
EndFunction
'---------------------------------------------------
FunctionGetMdbStaticRecordset(FileName,Source)
SetGetMdbStaticRecordset=GetMdbRs(FileName,Source,3,"")
EndFunction
'---------------------------------------------------
FunctionGetConnection(Param)
Dimconn
OnErrorResumeNext
SetGetConnection=Nothing
Setconn=Server.CreateObject("ADODB.Connection")
IfErr.Number<>0ThenExitFunction
conn.OpenParam
IfErr.Number<>0ThenExitFunction
SetGetConnection=conn
EndFunction

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息