English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

The standard way is to have a set of questions, and for each question a set of answers. You first decide how many questions you want, and then randomly select that many questions. For each question, you should put the answers in a random order also.

Today, it is probably a good idea to save the questions in an XML file. You could have a format like this:




What city is the capitol of England?
London
New York
Paris
Moscow


... more questions ...



Then you can write your program in whatever language you want. Java, Python, Perl, etc. all come with built-in support for working with XML files, so they might be good choices. Choose a language and look into the XML libraries. Here is a link to instructions for loading an XML file in Python:

http://pyxml.sourceforge.net/topics/howto/node18.html

Then look up how to work with random numbers. For example, in Python, you'd probably want to choose a random question like this:

import random
choice = int(random.random() * number_of_questions)

2007-01-12 07:37:28 · answer #1 · answered by Anonymous · 0 0

where? In which language?
HTML, C, PASCAL, JAVA, ... ?

For an HTML example check the source
of a page at
http://www.pekiyi.150m.com

2007-01-12 05:24:14 · answer #2 · answered by iyiogrenci 6 · 0 0

fedest.com, questions and answers