随即产生考试试题,有一段代码我看不懂,而且运行也没通过
<%@ LANGUAGE=VBSCRIPT%><%
response.Cookies("totaltime") = "300"
%>
<%
Dim num(),k,ans(),totalq
totalq = 100
redim num(totalq)
redim ans(totalq)
k = 1
randnomize
For i = 1 to totalq
x = Round(Rnd*totalq)
for j = 1 to k
IF num(j) = k
i = i-1
response.write "<script lanuage='javascript'>alert(i)</script>"
exit for
end if
next
if j > k then
num(k) = x
end if
next
for i=1 to totalq
ans(i) = "not attempted"
response.write num(i)& "<br>"
next
session("question") = num
session("answer") = ans
session("Counter") =1
session("examover") = 0
%>
<form name="examform" action="exam1.asp" method="post">
<input type= "hidden" name="qno" value =1 >
<input type= "submit" name="test" value =1 >
</form>
<script language="JavaScript">
//document.examform.submit
</script>
<p> </p>
</body>
</html>
随机产生考试试题,我一直纳闷j又没有赋值,怎么进行循环啊,有懂的人能帮我解释一下吗?