Quiz broke when upgrading to 1.4

Re: Quiz broke when upgrading to 1.4

by David Lamotte -
Number of replies: 0

I have just been bitten by the same "Fatal error: Call to a member function on a non-object in .../mod/quiz/lib.php on line 1005".  From the code it looked like it was  trying to access a non-existant question. 

As it turns it was only happening on a quizz that we knew was corrupted.  When the quizz was being set up, I added but then deleted again 30 questions.  Looking at the database tables, the question details had been removed, but their question numbers had not been deleted (ie they were listed in quizz.questions, but not in quizz_questions.id).

I fixed my problem by removing the missing questions from the questions field of the quizz table.

BTW, we first noticed that we had a corrupt quizz as the marks were all being scaled out of 70, when we only had 40 questions.  It was then that we found the 30 phantom questions.

Hope this helps,

David