From: gbateson Date: Fri, 8 Dec 2006 02:44:23 +0000 (+0000) Subject: fix undefined property "cr_timefinish", when viewing click report X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4db2e65f9d4dd1efde775cd66dc2563077e0fdea;p=moodle.git fix undefined property "cr_timefinish", when viewing click report --- diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index 0dfb8deb40..615db96dde 100644 --- a/mod/hotpot/report.php +++ b/mod/hotpot/report.php @@ -259,9 +259,14 @@ $users[$userid]->attempts[] = &$attempts[$id]; - if ($mode=='click' && isset($cr_attempts[$id])) { - $attempts[$id]->cr_lastclick = $cr_attempts[$id]->id; - $attempts[$id]->cr_timefinish = $cr_attempts[$id]->timefinish; + if ($mode=='click') { + // shortcut to clickreportid (=the id of the FIRST attempt in this clickreport series) + $clickreportid = $attempt->clickreportid; + if (isset($cr_attempts[$clickreportid])) { + // store id and finish time of LAST attempt in this clickreport series + $attempts[$id]->cr_lastclick = $cr_attempts[$clickreportid]->id; + $attempts[$id]->cr_timefinish = $cr_attempts[$clickreportid]->timefinish; + } } }