Emma is probably correct, but ....
The following may or may not fix the problem, but it wouldn't hurt to check ...
There is a hidden Moodle tool called "Health Check" ... you have to navigate to it via browser URL:
It can be intensive depending up what it might find so you might want to access in non-prime time.
One of the areas of Health Check are quizzes ... will list issues it might find, then there is a link to 'Solutions'. Sometimes those solutions offer an SQL query as a fix. So you will need to have either CLI access to a mysql client or phpmyadmin or moodleadminer.
'spirit of sharing', Ken