类型不匹配: 'cint'问题!
<!--#include file="dbconn.asp"-->
<!--#include file="config/config.asp"-->
<HTML>
<HEAD>
<TITLE><%=title%></TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link rel="stylesheet" type="text/css" href="css/index1.css">
<link rel="stylesheet" type="text/css" href="css/toolbar2.css">
<SCRIPT lanuage="javascript">
<!-- Hide
function checkdata()
{
if(document.test.chapter.value=="")
{
alert("请题目所属章节!");
return false;
}
if(document.test.num.value=="")
{
alert("题目数量不能为空!");
return false;
}
if (isNaN(document.test.num.value) )
{
alert("您填写的题目数量恐怕不正确!");
return false;
}
else if(document.test.num.value.length >2)
{
alert("您填写的题目数量恐怕不正确!");
return false;
}
}
// -->
</SCRIPT>
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<base target="_self">
</HEAD>
<BODY background="image/A-bg.gif" leftMargin=0 topMargin=0>
<!--#include file="config/title.asp"-->
<!--#include file="config/logo.asp"-->
<table align=center border=0 cellpadding=0 cellspacing=0 class=c width=760 height="35">
<tr>
<td height="13" width="177" valign="middle" align="center">现在位置:<a href="index.asp">首页</a>—测验 </td>
<td height="245" width="1" valign="middle" align="center" rowspan="3" >
<%chapterid=trim(request.form("chapter"))
num=cint(trim(request.form("num")))
RANDOMIZE
K=INT(6*RND)+1
dim order(11)
sql1="select * from 测验"
set rs1=conn.execute(sql1)
FOR i=0 TO RS1.Fields.Count-1
order(i)=RS1(i).Name
NEXT
if chapterid<>"" then
if chapterid="all" then
sql="select top "&num&" * from 测验 order by "&order(k)&" desc"
else
sql="select top "&num&" * from 测验 where 教程编号="&chapterid&" order by "&order(k)&" desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,2
if rs.eof then%>
<td height="13" width="674" valign="middle" align="center"></td>
<tr>
<td height="35" width="177" valign="middle" align="center"></td>
<td height="232" width="674" valign="top" align="center" rowspan="2">本章没有题目</td>
</tr>
<%else%>
<td height="13" width="674" valign="middle" align="center">
<form name=forms>
<div align=center>
<%
if chapterid="all" then
response.write "您选择了 全部题目 共"&num&"题"
else
sql5="select * from 教程 where 教程编号="&chapterid&""
set rs5=conn.execute(sql5)
response.write "您选择了 "&rs5("章节")&" "&rs5("标题")&" 共"&num&"题"
end if%>
<span class="unnamed1">考试时间:
<input type=text name=input1 size=9>
<script language=javascript>
<!--
var sec=0;var min=0;var hou=0;flag=0;idt=window.setTimeout("update();",1000);function update(){sec++;if(sec==60){sec=0;min+=1;}if(min==60){min=0;hou+=1;}if((min>0)&&(flag==0)){flag=1;}
document.forms.input1.value=hou+"时"+min+"分"+sec+"秒";idt=window.setTimeout("update();",1000);}
//-->
</script>
</span></div>
</form></td>
<tr>
<td height="35" width="177" valign="middle" align="center"></td>
<td height="232" width="674" valign="top" align="left" rowspan="2">
<form action="result.asp?chapterid=<%=chapterid%>&num=<%=num%>&order=<%=order(k)%>&j=<%=rs.recoderset%>" method=post name="form1">
<%i=1
rs.movefirst
Do While Not rs.Eof%>
<table border="1" width="95%" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="5" bgcolor="#A4D1FF" height="81">
<tr>
<td bgcolor="#A4D1FF" height="1" width="100%" colspan="2"> <%=i%>、<%=rs("题目")%></td>
</tr>
<tr>
<td bgcolor="#D9E2F7" height="1" width="50%"><input name=ans<%=i%> type=radio value="A">
A.<%=rs("A")%></td>
<td bgcolor="#D9E2F7" height="1" width="50%"><input name=ans<%=i%> type=radio value="B">
B.<%=rs("B")%></td>
</tr>
<tr>
<td bgcolor="#D9E2F7" height="1" width="50%"><input name=ans<%=i%> type=radio value="C">
C.<%=rs("C")%> </td>
<td bgcolor="#D9E2F7" height="1" width="50%"><input name=ans<%=i%> type=radio value="D">
D.<%=rs("D")%> </td>
</tr>
</table>
<br>
<%i=i+1
rs.MoveNext
Loop%>
<p align=center>
<input id=submit1 name=submit1 type=submit value="提交">
<input id=reset1 name=reset1 type=reset value="重填">
</form></td>
</tr>
<%end if
else%>
<td height="13" width="688" valign="middle" align="center"> </td>
<tr>
<td height="35" width="177" valign="middle" align="center"> </td>
<td height="232" width="688" valign="top" align="center" rowspan="2">请 选 择 题 目 属 性!
<p><img border="0" src="image/tnpic029.jpg" width="129" height="80"></p></td>
</tr>
<%end if%>
<tr>
<td height="197" width="177" valign="top" align="center">
<form method="post" action="test.asp" name="test" onSubmit="return checkdata()">
<select size="1" name="chapter" class="td1">
<%
id=request("id")
if id<>"" then
sql="SELECT * FROM 教程 where 教程编号="&id&""
set rs=conn.execute(sql)
response.write "<option value='"&rs("教程编号")&"'>"&rs("章节")& rs("标题")
response.write "</option>"
else
response.write "<option value=''>请选择题目所属的章节</option>"
end if
Set rs1=Server.CreateObject("ADODB.RecordSet")
mySQL = "SELECT * FROM 教程 order by 教程编号"
rs1.Open mySQL,conn,1,1
Do While Not rs1.Eof
response.write "<option value='"&rs1("教程编号")&"'>"& rs1("章节") & rs1("标题")
response.write "</option>"
rs1.movenext
loop
response.write "<option value='all'>"&"全部题目"
response.write "</option>"%>
</select>
<p>题目数量
<input type="text" name="num" size="4" class="td1" value="5" style="text-align: center;">
题</p>
<p>
<input type="submit" value="开始答题" name="A1">
</p>
</form>
<p>
</td>
</tr>
</table>
<!--#include file="config/copyright.asp"-->
</BODY>