-1

I need to create a quiz site and I'm not sure about how should I proceed with statistics. The site needs to track each users progress (which answer was answered how, how many time does it take to answer each question etc).

Should I create a new table (let's say 'statistics), and should I create a new row each time a user has finished a quiz? So, statistics:

  • user_id
  • quiz_id
  • answers (in serialized form, because the amount of questions is variable)
  • time_of_answer (same as above)
  • points_for_each_answer (same as above)

Wouldn't this be too slow, if the admin wants to check some stats, let's say: how many users have correctly answered the question #2 under the 3rd quiz?

4

1 回答 1

1

如果您需要它们作为真实实体,请不要序列化答案 - 只需给它们一个quiz_id外键,以便您知道它们属于哪个测验,使用适当的索引,一切都会顺利进行。

于 2013-10-31T11:49:41.133 回答