Not quite sure if this is the right place to ask a rather technical development question!?
We are developing a question plugin (CAPQuiz, already published), which worked fine with 120 odd students and 40 odd calculated questions. However, in the next assignment, using mainly STACK questions, performance degraded, and every page request to the CAPQuiz instance took annoyingly long. At busy times, the students often got blank screens or error messages.
Using a profiler and logging all queries in the DB engine, it seems that the problem is a ridiculous number of STACK related DB queries, even when no such question is needed by the page, all queries originating from the core API call to retrieve a question usage object. I believe we implemented CAPQuiz to use one question usage for all questions in the quiz, which would explain the behaviour I think. Only one question is actually needed per page presented to the student.
Could someone explain the rationale and intended usage of the question_usages table? I did not find this in the doc's. Would it be more correct/tidy to use on question_usages row per question in the quiz? If my hypothesis is correct, we should just rewrite CAPQuiz to use on question_usages row per question, but it would be useful with some confirmation before we start such a task. I'd appreciate any input to shed light on this, both conceptual and technical.
Thanks a lot in advance.