I’m developing a quiz module for a school with php and mysql. The requirements are simple:
1) There are 10 categories(subjects).
2) Select 8 random questions from each category and display them one by one.
3) Get the students input.
4) Calculate the result and display it.
Now, the problem that i face is how to make the script as efficient as possible. Efficient in the sense, make less database hits.
I want to store the 80 answers for that particular user in a place and then update them all at once in the DB. I don’t want to use cookies. In what way can i achieve that?
Are there any simple php quiz modules that i can refer?
Thanks 🙂
You clearly want a fast cache layer. I suggest either memcached or APC for that purpose. Session data may also work.
That said, you’d probably be better off using a full-stack PHP framework for this. A good one will manage caches for you. I suggest looking into symfony or CakePHP.
Here’s the real question, though: are you trying to address this problem up-front before you have established that there actually is a problem? This is a bad approach. Make sure you have a problem before you try to solve it.