|
Point 1:
If you record who has supplied a correct answer to the db, then when the person submits the answer and it is the correct answer simply do a count of the number of correct answers submitted up to that time and then subtract from 100.
IE: If I answer the question and I am the 5th person to answer the question then
total points - (5 points x 5th answer)
=75
You could then keep a score card showing which questions they answered and their score.
In response to the second part of this point, if the person tries to answer the question a second time, they could still be the 5th person but could receive a
penalty for guessing wrong
total points - (5 points x 5th answer) -(5points x (2 answers -1 guess))
=70
Point 2
When the user first enters the game you can query the db for the users points, as you save the users score each time they submit an answer you can record the points.
In general, each time you have to execute a query, it takes time, might only be milliseconds, but time either way and depending on the size of the program, this can add up. Try to keep things in memory.
Last edited by dgkindy; 11-19-2010 at 02:23 PM..
Reason: spelling mistake
|