Recently I had to create an online quiz, and we needed the answers to each question to appear in random order. I found that it's very easy to do in Javascript. Here's an example of a randomized list of choices:
1. First, create an array and name it ("choices")
2. Then list the items in the array (with html coding inside the single quotes)
3. Create a function that sorts the array based on a randomly generated number.
4. Finally, write the choices to the page (document.write).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.