Unable to add questions to quiz because it has no sections

Re: Unable to add questions to quiz because it has no sections

by Tim Hunt -
Number of replies: 2
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you are happy working in the database, you might be able to fix this.

First, make a new quiz somewhere (but don't add any questions), and then look at the data you get in the quiz_sections and quiz_slots table for that.

Then, look in those two tables, for the broken quiz id, and compare the differences.

If you feel confident, add manually fix the data for the broken quiz. (From the error message, it looks like you are missing a row in the quiz_sections table.)

However, please be very careful editing directly in the database.
Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Unable to add questions to quiz because it has no sections

by Susana L. -

Hi Tim, 

Thank you for your input.

Yes, the row is missing. But I don't care much about that specific quiz... and I avoid editing directly in the database, specially in production. My concern is that something is interfering with the consistency of the database, and I wanted to understand how it happened and avoid future problems.

Regarding your answer this doesn't seem to be such a strange problem (right?), however I don't find any reports of similar situations, nor bugs related to it... and I have no way of reproducing such a feat smile Please share If you have any idea what may have caused this situation.

Thank you!

 

In reply to Susana L.

Re: Unable to add questions to quiz because it has no sections

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Acutally, I think this is a strange problem. I don't recall seeing it before. If you do manage to reproduce it, let me know. Otherwise, I think it is OK to just ingore this as a one-off.