]> git.mjollnir.org Git - moodle.git/commitdiff
fix undefined property "cr_timefinish", when viewing click report
authorgbateson <gbateson>
Fri, 8 Dec 2006 02:44:23 +0000 (02:44 +0000)
committergbateson <gbateson>
Fri, 8 Dec 2006 02:44:23 +0000 (02:44 +0000)
mod/hotpot/report.php

index 0dfb8deb40b5d818c47fef56a56db9eae0be37c7..615db96dde1f9432db7e58bc9d2bc96df605f940 100644 (file)
 
         $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;
+            }
         }
     }