Respect database prefix in quiz module (2.2 edition)

Hi again,

This is the same patch as #2, backported to 2.2. It touches one additional file which no longer exists in the 2.3 version.