I’ve been working on a quiz section for one of my websites lately, well tried to anyway. One of the dumbest things happened. In a quiz you want to randomly pick questions and serve them to the visitor. That way they can answer them and shout WAHOO once they have one right.
Problem I had was that I couldn’t figure out how to sort all the questions in a completely random order, well semi random any way (since a computer does not know random as we do). I tried to do this by first counting the number of rows in the table and then creating a random array with 0..x (x being the number of rows). But this is very inefficient.
[Read More]