I have a v2.4.0 instance with a small course and quiz. The quiz has 6 questions, submitted together. Every time I submit the quiz, the view.php page gets slower. It started at around 3--4s, it's now up around 2 minutes, with the quiz submitted maybe 15 or 20 times. The page is so slow now that it times out, so I can't check the exact count.
I've looked at xhprof runs for this page, and I see the database query functions (oracle: oci_fetch_all, oci_execute being particularly bad) being called insanely many times for a single page load -- 20,000 calls or more. And this count has increased with each quiz submission as well. According to xhprof, these two functions consistently contribute about 80% of the time this page (script) is running.
Has anyone seen anything like this? How do I diagnose the cause of all these function calls? I can't imagine that moodle really needs to make 20,000 queries just to load the page that shows the table of previous quiz submissions...
I've looked over the performance settings and recommendations pages, only the bit about logs seems relevant. The current log table is a few MB and has only 8000 rows or so. I set a limit of 2 days in the cleanup settings, but most of these records were generated within the last 2 days anyway, and 8000 records doesn't seem very large.