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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flashcards from database- help with ideas.

Status
Not open for further replies.

kpdvx

Programmer
Dec 1, 2001
87
US
I want to make a "flashcards" like page (all one page with if statements, flashcard.php) that will query my database of words, display the word, and will present you with a form to enter the definition. Once the user enters the definition, the click a submit button, and the page presents the user with text telling them weather they got the definition right or wrong, and a link to go on to the next word.

Each word in the database (along with its corresponding definition) has a unique ID.

Also, Each word has something I call a Skill Level, a number from 1-5. So, the MySQL select statement would be something like "...WHERE skill = 1"; or whatever, depending on which Skill Level the user chose.

How could I randomize the words shown?

Any ideas on how I could code this?

Thanks!
 
The randomize part is easy. You can perform:

SELECT foo FROM bar ORDER BY rand() LIMIT 1

to get one word at random from the table.


The "gotcha" as I see it, is how "fuzzy" you're going to allow the answers to be. For example, you misspelled "whether" as "weather" in your post which started this thread. Would this be counted as wrong? Want the best answers? Ask the best questions: TANSTAAFL!
 
Hrm, I suppose it would- maybe it can teach the users (and me!) proper spelling... Thanks! :)
 
Hrm.. I've just run into some problems. Any idea how I could put this all into one file? If you get it wrong, it displays "Wrong!" and an option to go the the next random word, and if you get it right, it displays "Right!" and an option to go to the next word.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top