Say I have a database setup full of a questions (I have barely any experience with mySQL databases online) each with a given answer (A through E). Is there a script that will randomly call a predetermined number of questions randomly from this database, display them on the web page and give the user the solutions after the questions are finished?

Very vague I know, but I am a novice here who has found no help on Google over many searches.

Fumigator

02-19-2009, 07:45 PM

It's a very popular application and you can find plenty of pre-built quizes via google. Try the keywords +php +quiz +script.

Old Pedant

02-19-2009, 09:29 PM

Fumigator assumed you are using PHP for the scripting language. If not, please say what you are using.

The UUID_SHORT() function essentially assigns a random number to each of your returned records. You then ORDER BY those random numbers and LIMIT the selection to only 10 questions. Presto.

Untested, but it should work.

Now, that doesn't help with the rest of your problem (that is, grade the answers and show correct answers), but exactly how to do that will depend somewhat on what server-side language/framework you are using.

Fumigator

02-19-2009, 10:57 PM

In your Google search replace "PHP" with whatever scripting language you use for similar results. Pretty self-explanatory. :thumbsup:

colby2152

02-19-2009, 11:03 PM

In your Google search replace "PHP" with whatever scripting language you use for similar results. Pretty self-explanatory. :thumbsup:

Thanks Fumigator... my google search was "random question script (php)" where php would be replaced by cgi or java. Your search sure does a better job!:thumbsup: I'll be tuning back here next week with questions. I like this forum already.