random.asp

来自「基于ASP的在线考试系统的设计与实现,想下一的可以看一下基于ASP的在线考试系统」· ASP 代码 · 共 47 行

ASP
47
字号
<%@ Language=VBScript %>
<%
Response.Cookies("totaltime")="300"
%>
<%
 Dim num(), k,ans(),totalq
 totalq=100
 redim num(totalq)
 redim ans(totalq)
 
    k = 1
     Randomize
     For i = 1 To totalq
         x = Round(Rnd * totalq)
         For j = 1 To k
            If num(j) = x Then
               i = i - 1
               Exit For
            End If
         Next
         If j > k Then
            num(k) = x
            k = k + 1
         End If
     Next
     for i=1 to totalq 
       ans(i)="Not Attempted"
       Response.Write num(i)& ".<br>"
     Next
     Session("Questions")=num
     Session("Answers")=ans
     Session("Counter")=1
     Session("examover")=0  
  'Response.Cookies("totaltime")= "400" 'cstr(totaltime)   
%>
  <form name=examform action="exam1.asp" method=post>
  <input type=hidden name=qno value=1>
  <input type=submit name="xxxxxxxx" value=1>
  
  </form>
  <script language="JavaScript">
    // document.examform.submit()
  </script>   
<P>&nbsp;</P>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?