DETAILS
I have a poll (let's call it quiz1). Quiz1 uses the same list of words every time it is generated. If the user needs, they can skip words to complete the quiz. Id like to store these missing words in mysql and then run statistics on them.
At first, I was going to store the missing words in one column as a row. Each word will be separated by a comma.
|testid | missedwords | score | userid | ************************************************************************* | quiz1 | wordlist,missed,skipped,words | 59 | 1 | | quiz2 | different,quiz,list | 65 | 1 |
The problem with this approach is that I want to show statistics at the end of each quiz about what words most often were missed by users who took quiz1.
I assume that saving the missing words in one column, as indicated above, is ineffective for this purpose, since I will need to extract the information and then count it - (perhaps with php if I did not save this data in a separate table).
Then I thought that I needed to create a separate table for the missing words. The advantage of the table below is that it should be easy to count the words from the table below.
|Instance| missed word | ***************************** | 1 | wordlist | | 1 | missed | | 1 | skipped |
Another approach I could create a table with the counts and update it every time the quiz is done.
Testid | wordlist| missed| skipped| otherword| ************************************************** Quiz1 | 1 | 1| 1| 0 |
The problem with this approach is that for each quiz I will need a different table, because each survey will use different words. Also, information is lost, because only the tally is not stored in the corresponding data that the user missed, what words.
Question
Which approach would you use? What for? Alternative approaches to this task are welcome. If you see flaws in my logic, feel free to list them.
EDIT Users will be able to repeat the quiz as many times as they want. Their information will not be updated; instead, a new instance will be created for each quiz they returned.