Fatal error: Call to a member function summarise() on null

Fatal error: Call to a member function summarise() on null

by A. Obeid -
Number of replies: 2

Hi

we get this error in only one attempt:


Fatal error: Call to a member function summarise() on null in /var/www/html/moodle-3.3.2/question/type/ddimageortext/questionbase.php on line 65

This error blocks the cron-script and attempts arn't closed.

This Quiz have 1534 Attempts 

  64  $selected = $this->get_selected_choice($place->group, $response[$this->field($placeno)]);
-> 65  $summarisechoice = $selected->summarise();

Average of ratings: -
In reply to A. Obeid

Re: Fatal error: Call to a member function summarise() on null

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Did you, by any chance, edit that question after some students had attempted it? (You can verify that by comparing the time of the quiz attempts with the time the question was last edited.)

The code should be robust in that case, but until that is fixed, the work-around is: don't do that!

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Fatal error: Call to a member function summarise() on null

by A. Obeid -

I ask the course trainer, most probably yes, he edit question after quiz was started.

cron continued his work after excluding the line: //$summarisechoice = $selected->summarise()