Problem with Rnd Function
am 28.06.2007 08:56:42 von vinodkusWhen I use Rnd function in asp. It gives the random no but it always
gives the same random number. What is its problem can any body tell
me.
Actually I have to made a program for online examination and question
will be select randomly category wise. It means if any body select G.K
category then only G.K type of question will be selected with three
wrong answer and right answer. But my problem is that selected series
of question is fixed. But it require to change if any body run the
program next time what is my problem? Can any body tell me.
The table that i m using is
in_question(qnum int,
Que_catg varchar,
question varchar,
option_a varchar,
option_b varchar,
option_c varchar,
option_d varchar,
right_ans char,
Question_Date datetime,
Status char
)
Here is my three file rand.asp, rand1.asp, rand2.asp I m giving the
details of my program file wise
rand.asp
rand1.asp
rand2.asp
<%
marks = 0
rt_ans = Session("rt_ans")
rt_ans = split(rt_ans,",")
chk = Request.form("chk")
chk = split(chk,",")
for i = 0 to ubound(rt_ans) - 1
if trim(rt_ans(i)) = trim(chk(i)) then
marks = marks + 1
end if
next
response.write("Total Marks " & marks)
%>