Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp quiz with random order of questions

Status
Not open for further replies.

matejv

Programmer
Jul 30, 2003
14
SI
Hi,

I am sure you all know the 101's ASP Quiz sample (
I would like to upgrade this fine sample with the ability of the script generating a different (random) order of the questions in the db.

At first I thought this would be a simple procedure of making a random recordset, but since the numbers of the questions are also stored in the database and the questions increase in the way of c = c + 1, it does not seem so simple :)

Any ideas? Thanks.
 
questionTable
id
question
ansA
ansB
ansC
ansD
correntAns

testOrder
userID
q1
q2
q3
q4
q5
q6
q7
q8
q9
q10

now when someone is getting ready to take the test, assign the questionIDs in random order and put the IDs in q1..q10


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Thanks, but... how exactly can I execute that? TestOrder is a table, right? So, why would I write the questions into the table. As i see it the problem is not so much in the order of the questions as it is in the order of answers, which than the script tracks to calculate the result at the end.
Please, if you can, try to explain the concept you propose a bit more.
Thank you very much!
 
You just want to pull back a random selection of say 10 questions?

Randomize
R=clng(10000*rnd)

rs.open "SELECT top 10 * FROM tblQuestions ORDER BY rnd(-(QuestionID *" & R & "))",conn

This will pull back 10 completely random questions

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top