Click to See Complete Forum and Search --> : Choices
danasegarane
07-30-2007, 01:42 AM
Hi all,
I want to get user info for about 50 questions. I have stored the info(questions and choices) in a access table. I want to show the questions and choices in a random order.How can I do this
Thanks in Advance
Dana
Chikara
07-30-2007, 02:59 PM
Please give more detail. You want random questions with random answers?
danasegarane
08-03-2007, 08:31 AM
Hi Chikara,
Thanks for your reply. I am using MSAccess as my back end. In that I have a table with this structure.(tblquestions)
1.Questionid(Autonumber)
2.QUestion(text)
3.Choice1(Text)
4.Choice2(Text)
5.Choice3(Text)
6.Choice41(Text)
7.Choice5(Text)
This table contains 50 question
Now I want to display these questions in a random order to the user and store his selection in a table?.How can show the records in a random Order
Dana
Chikara
08-03-2007, 09:29 AM
So the things listed above are columns or rows?
If they are rows, you can just generate a random number with ASP that is less than or equal to the number of rows that you have. Then just do something like this.
While intRandom <> counter
objRec.MoveNext
counter = counter + 1
wend
Then just use response.write to display information.
I will work on a clever way of doing this with columns, but give me a little more time.
Chikara
08-03-2007, 11:17 AM
Well I can't think of any straight forward way to randomly return a column. I would imagine that this is possible. Look into Collections and prehaps Scripting.Dictionary. Sorry I can't solve this for you.
lmf232s
08-03-2007, 05:57 PM
See if you can use the RND function in your order by clause to select a different random number every time its ran.
ORDER BY RND(ID)