I have been discussing this problem with Ken Wilson in the installation forum and we have come to a standstill. He suggested that I post what we had done in the quiz forum since the problem appears to be in the update table when a quiz is attempted. Hope someone can come up with a suggestion. here is what has gone before:
What can cause this?
by Tom Wallace - Saturday, 26 April 2008, 10:01 AM
I am running a single moodle class which contains 31 quizzes, and allows anyone to create their own account. The server is
Windows 2003 server, with IIS 6.x, Apache 2.2.8, PHP 5.2.5, MySQL 5.0.45, and Moodle 1.8.4. I continually get the error that the
quiz file cannot be updated. This message comes from the quiz module. If I attempt to make a change to a quiz in the
administrator account, I get a similar error, but if I attempt to change anything else I am successful so the error appears to be
in the MySQL database corresponding to the quizzes.
If I restart the MySQL the error goes away and then the quiz can be taken and all of the error prone modules work as expected for
a short while, then the errors occur again. This happens with both IE6.x and Firefox.
Has anyone else experienced this type of problem?
Thanks.
-------------------------------------------------
Re: What can cause this?
by Ken Wilson - Monday, 28 April 2008, 12:32 AM
Tom
Can you please try turning on the MySQL error log. Add something like this line at the end of your my.ini file:
log-error="F:/MySQL/log/mysql.err"
Change the path to suit your own server and restart the service after changing the my.ini file. Let us know what is reported in
the file when the problem re-occurs.
Ken
-------------------------------------------------------------
Re: What can cause this?
by Tom Wallace - Monday, 28 April 2008, 10:31 AM
Thanks for the advice. When I did what you told me to, I went in after restarting MySQL and completed 2 quizzes. I then
exited the browser without logging out of Moodle, went back in as the same student account and got the same errors. This is what
was in the Mysql.err file:
080427 22:15:11 InnoDB: Started; log sequence number 0 64941538
080427 22:15:11 [Note] E:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: ready for connections.
Version: '5.0.51a-community-nt' socket: '' port: 3306 MySQL Community Edition (GPL)
This was put in the file when the service restarted so it looks like no error was ever registered.
Any other suggestions? I am open to anything. Thanks.
--------------------------------------------------------------
Re: What can cause this?
by Ken Wilson - Monday, 28 April 2008, 01:46 PM
Can you post back the exact error message you're getting, Tom. I just can't find anything in the Moodle errors which have
something like "quiz file cannot be updated" in them, and it looks like it's not a MySQL problem after all.
-------------------------------------------------------------------------
Re: What can cause this?
by Tom Wallace - Monday, 28 April 2008, 09:02 PM
The error is: "Failed to save the current quiz attempt!" It is on line 393 of attempt.php under Moodle\mod\quiz. The code is:
/// Update the quiz attempt and the overall grade for the quiz
if ($responses || $finishattempt) {
if (!update_record('quiz_attempts', $attempt)) {
error('Failed to save the current quiz attempt!');
}
if (($attempt->attempt > 1 || $attempt->timefinish > 0) and !$attempt->preview) {
quiz_save_best_grade($quiz);
}
}
Hope this helps.
Thanks.
-------------------------------------------------------------------------
Re: What can cause this?
by Ken Wilson - Monday, 28 April 2008, 09:47 PM
That's helpful - thanks. Looking at the code behind that function (update_record) the SQL that could generate an error is the
UPDATE statement. A couple of things to try:
Try running a repair on the database or the quiz_attempt table. See this entry in the Admin FAQ. You can also try running the
mdl-db-opt.php script in this post. Before doing anything to your database, remember to make a backup first.
Try turning-on debugging in SIte Admin -> Server -> Debugging -> Developer. Do you see any messages displayed?
Thanks
Ken
--------------------------------------------------------------------
Re: What can cause this?
by Tom Wallace - Tuesday, 29 April 2008, 10:03 PM
Thanks for your help. I have tried everything you have suggested to no avail. When I run the database repair, everything
comes up OK. When I turn on the debugging, I get the html code on the buttons and no one can go into a quiz to see what comes up.
The error logs only show failed login attempts and where an individual goes into a quiz and is given an immediate retry then quiz
close. No indication as to why.
Any other suggestions? I am open to anything at this point, including reinstalling.
Thanks again.
--------------------------------------------------------------------
Re: What can cause this?
by Ken Wilson - Tuesday, 29 April 2008, 10:29 PM
Thanks for your patience Tom. The essence of this is that something is preventing the mdl_quiz_attempts table from being updated.
It could be file permissions, mysql grant privileges, a corrupt table or simply out of disk space.
If Moodle is working fine and users are accessing the quiz, then it looks like it isn't any of these problems.
Unless someone else has any suggestions, can I suggest that you (a) take this one to the specialists in the Quiz Forum
while (b) try re-installing or upgrading as you wait for a reply.
Sorry I couldn't have been any more helpful!
Ken
------------------------------------------------------------------
Re: What can cause this?
by Tom Wallace - Monday, 28 April 2008, 09:25 PM
I can very much be wrong, but it appears that the database is being opened and never closed. I went back and attempted a
quiz then logged out totally using the logout and then closed the browser. When I went back in, I received the errors.
I closed my browser and deleted all the cookies and temporary files then tried again and still received the error. I changed
to Firefox and still received the error which indicates to me that the error is with the database, Moodle, or PHP and not with
the browser. The only thing that is consistent in all the attempts is closing the browser.
How is the database closed to an individuals attempt?
Thanks.