Hi Patrick
About the relevance: There is a big difference though: The
original issue is about Moodle 5.0 - you are on 4.5 - and between Moodle 4 and 5 the quiz system was completely overhauled. I must say, I'm glad that you haven't joined "my" discussion: Have you ever seen a doctor treating two patience at once?
Anyway continuing your issue in this thread (the
OP has given up, it seems and his follower sidelined), "these are not duplicates generated by Moodle when duplicating tests" is a huge relief. I had close to 3 million questions at its peak, people have reported 11 million!
The hierarchical question banks, through course category levels, is a strong organization tool. My experience is, if you use it at large scale, it puts a lot of pressure on the system. On top of that, the hierarchical model is deprecated. Moodle 5 has an entirely different model. So for the long-term you need some planning. If everything goes well, the upgrade to 5, 5.1 currently, reorganize them for you. But I haven't put that to test. Still in 4.5, planning 5.1 for Summer - optimistically.
Now for your current situation, the next step is to search for "unclean" data. There were all kinds of health checks,
SQL scripts, (home-grown!) repair scripts. I have tried many of them, don't have a record what helped and what not. No use either, I'm repeating, you are asking for my medicine whereas none of us know whether your ailment has exactly the same cause as mine.