网上考试系统程序代码.pdfVIP

  • 1
  • 0
  • 约2.27万字
  • 约 17页
  • 2026-02-14 发布于青海
  • 举报

网上考试系统程序代码

【例9-1】注册源程序代码

%@language=″vbscript″%

%if(″http_method″)=″post″then

if(″submit″)=″学生考场″then′学生进入在线考试系统登录的处置

setconn=(″″)

=″dsn=testsys″′连接并打开相应的数据源名testsys

strsql=″select*fromstudentinfowherestid=′″(″stid″)″′and

stname=′″(″stname″)″′″

setmrs=(strsql)

ifnotandnotthen

′假设数据库中存在该学生的相应的记录就可进入考试系统,并用session属性存储当前

学生的姓名与学号信息

session(″stid″)=(″stid″)

session(″stname″)=(″stname″)

″″

setmrs=nothing

else

″学生姓名或学号输入有错误!″

′假设数据库中不存在该学生的信息就返回,显示页面,并给犯错误提示

Endif

setconn=nothing

else

′出卷教师进入在线考试系统的处置。

setconn=(″″)

=″dsn=testsys″

strsql=″select*fromteacherinfowhereteachid=′″(″teachid″)

″′andteachname=′″(″teachname″)″′″

setmrs=(strsql)

ifnotandnotthen

session(″teachid″)=(″teachid″)

session(″teachname″)=(″teachname″)

′假设数据库中已有该教师的记录,那么进入在线考试系统,用session属性保留当

前教师姓名与编号信息

″″

else

″教师的姓名或编号输入错误!″

′假设数据库中不存在该教师的信息,页面返回并显示,并给出提示错误信息

endif

setmrs=nothing′关闭数据库连接并释放对象

setconn=nothing

endif

endif%

html

title在线考试系统登录主界面/title

bodybackground=″″palign=″center″

imgalign=centersrc=″″/p

formaction=″″method=″post″id=″form1″name=″form1″

palign=″center″

tableborder=″1″cellpadding=″1″cellspacing=″1″width=″90%″

trbgcolor=″#efa5ff″

tddivalign=″center″

fontcolor=″blue″face=″粗体″size=″7″考生入口主界面

/font/div/td

tddivalign=″center″

fontcolor=″red″face=″粗体″size=″7″教师入口主界面

/font/div/td/tr

trbgcolor=″#efd7ff″

tdpalign=″center″姓名inputid=″text1″name=″stname″/p/td

tdpalign=″center″姓名inputid=″text2″name=″teachname″alue=″

小华/p/td

/trtrbgcolor=″#ffd7ff″

tdpalign=″center″考生学号inputid=″password1″

name=″stid″type=″password″/p/td

tdpalign=″center″fontface=宋体id/font编号input

id=″password1″name=″teach

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档