We have a bug, but it was created from a much-needed and wonderful hack.
Joseph, Moodle extraordinaire, made a wonderful hack in mod/lesson/view.php that allows us to measure the amount of time a person spends in a course. This was the hack:
**************************************************************
$duration = $attempttime->lessontime - $attempttime->starttime;
was turned into
$duration += $attempttime->lessontime - $attempttime->starttime;
*****************************************************************
It works wonderfully, and I am so grateful. We have a problem that arose out of that hack, and I am trying to fix it. Joseph is retiring and he is seldom on here, and none of the other moderators seem to know how to fix it. Here is the message we get.
***************************************************
Notice: Undefined variable: duration in /home/(my id)/public_html/(my domain)/mod/lesson/view.php on line 111 This page should automatically redirect. If nothing is happening please use the continue link below.
Error output, so disabling automatic redirect.
***********************************************************
How can I define "$duration +" and get rid of this message?