# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- D:\xampp\htdocs\moodle_master\lib\datalib.php +++ D:\xampp\htdocs\moodle_testing\lib\datalib.php @@ -1844,13 +1844,17 @@ $params['courseid'] = $courseid; } $params['userid'] = $userid; - $params['coursestart'] = $coursestart; + $params['coursestart1'] = $coursestart; + $params['coursestart2'] = $coursestart; + $params['coursestart3'] = $coursestart; - return $DB->get_records_sql("SELECT FLOOR((time - :coursestart)/". DAYSECS .") AS day, COUNT(*) AS num + $sql = "SELECT FLOOR((time - :coursestart1)/". DAYSECS .") AS day, COUNT(*) AS num FROM {log} WHERE userid = :userid - AND time > :coursestart $courseselect - GROUP BY FLOOR((time - :coursestart)/". DAYSECS .")", $params); + AND time > :coursestart2 $courseselect + GROUP BY FLOOR((time - :coursestart3)/". DAYSECS .")"; + + return $DB->get_records_sql($sql, $params); } /**