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

PHP - JS Trivia 2

Status
Not open for further replies.

triquad

Programmer
Feb 5, 2009
16
0
0
EG
I want to make a timed interactive trivia using PHP & JS. I want it to be like whenever the user chooses to start playing. It displays an image that contains the question plus another 4 images that contain the answers for the user to choose the right one from plus the timer that shows the time counting down. Whenever the user selects an answer the timer stops & the color of the image the user has selected turns either red or green to show him/her if the answer is right or wrong. that should remain for 2 or 3 seconds & after that a new question appears & the whole process gets repeated until the user reaches question number 10.

The questions should be displayed randomly from the database & each question should not be displayed twice until the end of the trivia. The score should be calculated depending on the user's choice & the time he/she took to select the answer (i.e. if the user selects the right answer after 2 seconds he/she gets for example 2000 points if the choice was made later on the score is decreased etc..). The score should be accumilative as the user goes on with the questions until the end of the trivia.

Finally, the score is displayed, saved in the mySQL database, & whenever the user tries to access the ranking table, it calls his score from the database, locates & displays his/her rank depending on the score. If he/she plays another trivia, the score gets added & displayed. One last thing is that trivia game should be a single or multiplayer game.

It seems complicated & actually I tried to edit some trivia I got from a forum but I have some problems displaying the images stored in mySQL database as it displays ASCII code instead of the image & it's a single user game that doesn't calculate or accumilate the user's score. that's why I thought I should start doing it from the beginning.

I'm a PHP & JS beginner so I need to know how to do that & how to start.
 
Hi

Very different rules, but quite similar concept, so I would say take a look at Google Image Labeler.

Probably the most stable would be a Java applet or a Flash animation, but AJAX could be enough.

( See forum269, forum250 and forum1600 for more. )

Feherke.
 
This can be completely done with AJAX. This is a pretty general question however, and I cant really answer what you're asking. Are you looking for a place to start, a discussion of the process?

You will be usin setInterval probably for the timers, and alot of AJAX calls for data transfer. I would have a look at the prototype libraries AJAX functions -

If you have more specific questions, let me know.

Scott Prelewicz
Web Developer
COMAND Solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top