We've been using the STACK question type for a number of courses -- I've been using it in a computer systems course where I've managed to wrangle things to have students do binary arithmetic, IEEE floating representation etc all as stack questions.
However, we find that it's occasionally slow and are trying to figure out why. One particular example is when asking for exam statistics on a quiz with ~200 students using ~10-12 different STACK questions each. Using the 'statistics' tab in the quiz takes 3-5 minutes to present the statistics.
Likewise, when creating an instance of a quiz for ~200 students (e.g. as part of an in-class exam), it may take several seconds to a couple of minutes to have an exam created for all the students. Our Moodle setup runs across multiple servers, structured as a NGINX front-end talking to multiple fpm+stack backends, all managed by Kubernetes. We're using a Google managed mysql database.
Much of the DB activity is related to mdl_qtype_stack_cas_cache, which makes sense --- but it's not clear why access to this would be so slow that it takes 3-5 minutes to generate a quiz statistics report. We've been trying to figure out if we have the DB mis-configured so that e.g. it's using table locking rather than row locking or something or if the indexing is incorrectly configured.
Have other people had problems like this? Is there a tuning guide we should examine?