"Error writing to database" when creating quiz

"Error writing to database" when creating quiz

by Dariya Ainekova -
Number of replies: 8

I am using 3.10 (Build: 20201109)

The quizzes I have created since Nov. 25, 2020,  for my course, receive the error "error writing to database". All my Quizzes  consist of  Embedded answers (Close) type questions).  Quizzes created before yesterday work fine.

Here is the beginning of the error log:  

How do I troubleshoot this please?  



Average of ratings: -
In reply to Dariya Ainekova

Re: "Error writing to database" when creating quiz

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

What database type (MySQL, MariaDB, PostgreSQL or SQL Server) and version is this?

Can you change Debug messages to DEVELOPER, hopefully there'll be more details shown.

Also, do you mind telling us which country this site is in? This error reminds me of something I've seen before which was to do with locale settings.

Average of ratings: Useful (1)
In reply to Leon Stringer

Re: "Error writing to database" when creating quiz

by Dariya Ainekova -


error log
In reply to Dariya Ainekova

Re: "Error writing to database" when creating quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Not helpful to post the error message a an image, particuarlly when it is an unreadable block of characters. If it was text I could copy and paste it into a text editor and break it apart.

Anyway, by squinting, I could see that the problem is that minfraction and maxfraction are NAN.

I supect that what is going on is that all the parts of your question are worth 0 marks, and yet the question is trying to be worth 3 marks, leading to a division by zero.

What are the settings for this question? It is question id 7902.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: "Error writing to database" when creating quiz

by Dariya Ainekova -

Thank you for your suggestion! I will look into it asap!

When I am uploading error messages as texts my posts are being blocked as spam. I've been advised by administrators to upload them as pictures. 

In reply to Tim Hunt

Re: "Error writing to database" when creating quiz

by Dariya Ainekova -
Dear Tim Hunt,
You are right! All of my of my Quiz questions consist of Embedded answers (Close) type questions. The first question weighted nothing but zero. After I assigned a grade to the question everything has started to work as usually!
Thank you!
In reply to Dariya Ainekova

Re: "Error writing to database" when creating quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I wonder if there should be validation on the form for editing Cloze questions, to prevent people making this mistake?
In reply to Tim Hunt

Re: "Error writing to database" when creating quiz

by Dariya Ainekova -

I googled but was not able to locate someone with the  problem and a solution. 

In reply to Dariya Ainekova

Re: "Error writing to database" when creating quiz

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If anyone can come up with a solution Tim can.
Average of ratings: Useful (1)