I had the exact same thing happen to me. I tried your suggestions above, but they didn't work.
The problem: 4 questions total, but could only score 80% (4/5). The system thought there was another question somewhere.
In the Quiz table, I edited 2 fields to correct the issue. The "questions" field had 5 entries. Knowing that I had only 4 questions, I kept eliminating one of the numbers and then trying a test to see if a question disappeared. I finally found one that I could eliminate that didn't make a question disappear. That one, I left deleted.
The second field was called "sumgrades" and had the number 5 in it. Again, knowing that I only had 4 questions, I reduced this to 4 in the field, saved the change (at the database level). Then tried taking the test again.
Yes! It worked! I scored 100%.
What may have caused this?
In making the test, I added a random question, then learned what it was for, then deleted it. This was the only delete I made, so maybe this caused then to get out of sync. Sounds like a bug.