主頁 > 知識庫 > 如何實(shí)現(xiàn)網(wǎng)上考試?

如何實(shí)現(xiàn)網(wǎng)上考試?

熱門標(biāo)簽:遼寧營銷智能外呼系統(tǒng)價格多少 400電話是怎么申請 推銷電話機(jī)器人怎么打電話的 常州智能外呼電銷機(jī)器人如何 武漢如何辦理400電話 語音電銷機(jī)器人視頻 重慶400電話哪里辦理 教育機(jī)構(gòu)地圖標(biāo)注 自適應(yīng)地圖標(biāo)注

login.asp

' 考生驗(yàn)證.
@ Language=VBScript>

name=trim(request("name"))
passwd=trim(request("passwd"))
if name>"" and passwd>"" then

' 檢查考生是否輸入用戶名和密碼.
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver(
.mdb)};

dbq=" Server.MapPat("exercise.mdb")
set rs= server.createobject("adodb.recordset")
sql= "select
from  user  where user=
'"
name"' and passwd='" passwd "'"
Set rs= conn.Execute(sql)

' 驗(yàn)證考生合法性.
if not(rs.eof) then
if rs("score")>0 then

' 檢查考生是否已參加過考試,若是則進(jìn)行成績查詢.
response.write rs("user")
"的考試成績是"rs("score")
else
session("pass")=1
session("user")=name
response.redirect "test.asp"
end if
else
Response.Write "
,您輸入的用戶名或密碼不正確!"
end if
else
end if
>
html>
head>
META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
title>
撼雪噴云之考生登錄/title>
/head>
body>
FORM action="login.asp" id=
FORM1 method=post name=FORM1>
P title="">
nbsp;/P>
P title="">
nbsp;/P>
P title="" align=center>
考生:
INPUT id=text1 name=name style="HEIGHT:22px; WIDTH: 103px">/P>
P title="" align=center>
密碼:
INPUT id=password1 name=passwd style="HEIGHT: 23px; WIDTH: 101px" type=password>/P>
P title="" align=center>

INPUT id=submit1 name=submit1 type=submit value="進(jìn)入 " style="FONTSIZE: medium; FONTSTYLE: normal; FONTVARIANT:normal; FONTWEIGHT: bold" title="">/P>
P title="" align=center>
/P>
/FORM>
/body>/html>


test.asp

' 從題庫中取題考試.
@ Language=VBScript >

if session("pass")>1 then
response.redirect "login.asp"
else
end if
Set  conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (
.mdb)};
dbq="
Server.MapPath("exercise.mdb")
sql="select
from test"
Set rs = conn.Execute( sql )

' 提取試題.
>

script LANGUAGE="javascript">
var isn1=null;
var isn2=false;
today=new Date();
function stopit(){
if(isn2){
  clearTimeout(isn1);
  }
isn2 = false;
}
function startit(){
stopit();
isnclock();
}
function isnclock(){
var now=new Date();
var hrs=now.getHours();
var min=now.getMinutes();
var sec=now.getSeconds();
document.clckh.disp.value=""
((hrs>12) ? hrs12 : hrs);
document.clckm.disp.value=((min10) ? "0" : "")
min;
document.clcks.disp.value=((sec10) ? "0" : "")
sec;
document.clck.disp.value=(hrs>=12) ? "p.m." : "a.m.";
isn1=setTimeout("isnclock()",1000);
isn2=true;
}
/script>

' 以上是一個計時函數(shù).

html>
head>
META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
/head>
body onLoad="startit()" BGCOLOR="FFFFFF">
center>
'
調(diào)用計時函數(shù)顯示時間.
TABLE BORDER=2>
tr>
td>Time/td>td>Hour/td>td>Min/td>td>Sec/td>td>/td>
/tr>
tr>
td>/td>
td VALIGN=TOP>FORM NAME="clckh" onSubmit="0">
INPUT TYPE="text" NAME="disp" SIZE=2 VALUE ="">
/FORM>/td>
td VALIGN=TOP>FORM NAME="clckm" onSubmit="0">
INPUT TYPE="text" NAME="disp" SIZE=2 VALUE ="">
/FORM>/td>
td VALIGN=TOP>FORM NAME="clcks" onSubmit="0">
INPUT TYPE="text" NAME="disp" SIZE=2 VALUE ="">
/FORM>/td>
td VALIGN=TOP>FORM NAME="clck" onSubmit="0">
INPUT TYPE="text" NAME="disp" SIZE=4 VALUE ="">
/FORM>/td>/tr>
/center>

FORM action="result.asp" id=FORM1 method=post name=FORM1>

' 顯示試題.
P>
nbsp;/P>
P>
 

  i=1
  rs.movefirst
  do while not rs.eof
>
  P>
nbsp;nbsp; =rs("question")>/P>
TABLE align=center border=1 cellPadding=1
cellSpacing=1 width="80
">
  tr>
  td style="WIDTH: 50
" width="50">
INPUT name=ans
=i> type=radio value="A">=rs("a")>/td>
td>INPUT name=ans
=i
type=radio value="B">
=rs("b")>/td>/tr>
  tr>
td>INPUT name=ans
=i>
type=radio value="C">
=rs("c")>/td>
td>INPUT name=ans
=i>
type=radio value="D">
=rs("d")>/td>
  /tr>
/TABLE>

i=i
1
rs.movenext
loop
>
/P>
P>/P>
P align=center>INPUT id=submit1 name=submit1 type=submit value=
交卷>

INPUT id=reset1 name=reset1 type=reset value=Reset>/P>/FORM>
/body>/html>


result.asp

' 評分并將成績記錄到數(shù)據(jù)庫.
@ Language=VBScript >
html>
head>
META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
/head>
body>
P>
nbsp;/P>

name=session("user")
dim score
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver(
.mdb)};

dbq=" Server.MapPath("exercise.mdb")
sql="select ans from test"
Set rs = conn.Execute( sql )
ycorrect=0
rsCount=0


Response.Write "
標(biāo)準(zhǔn)答案:"

' 給出標(biāo)準(zhǔn)答案并評分.
Do while not rs.eof
Response.Write rs("ans")
rsCount=rsCount
1
if Request.Form(rsCount)=rs("ans") then
ycorrect=ycorrect
1
end if
rs.movenext
loop
Response.Write "br>
您的答案:"
score=int(ycorrect/rscount
100)
for i=1 to Request.Form.Count
1
Response.Write Request.Form(i)
next
Response.Write "br>"
Response.Write "
您的成績:"score
if score60 then Response.Write "
別難過,您不及格!""br>"
else if score>=60 Response.Write "
幸好,您及格了!""br>"
else Response.Write "
恭喜,您獲得了優(yōu)秀!"


strSql="insert into user (result) values ("
score")
where user='"
name"'"
conn.execute(strSql)

' 將成績存到數(shù)據(jù)庫.
>
/body>/html>

 

[1]

標(biāo)簽:遵義 柳州 襄陽 威海 中山 雞西 邯鄲 朔州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《如何實(shí)現(xiàn)網(wǎng)上考試?》,本文關(guān)鍵詞  如何,實(shí)現(xiàn),網(wǎng)上,考試,如何,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《如何實(shí)現(xiàn)網(wǎng)上考試?》相關(guān)的同類信息!
  • 本頁收集關(guān)于如何實(shí)現(xiàn)網(wǎng)上考試?的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章