mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-50833 report: Still make a chart if there are no logs
This commit is contained in:
parent
e5eefbbf01
commit
06c9c36bdc
@ -123,16 +123,17 @@ if ($type === "usercourse.png") {
|
||||
|
||||
$rawlogs = report_log_usercourse($user->id, $courseselect, $coursestart, $logreader);
|
||||
|
||||
if (empty($rawlogs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($rawlogs as $rawlog) {
|
||||
$logs[$rawlog->day] = $rawlog->num;
|
||||
}
|
||||
|
||||
$graph = new graph(750, 400);
|
||||
|
||||
if (empty($rawlogs)) {
|
||||
$graph->parameter['y_axis_gridlines'] = 2;
|
||||
$graph->parameter['y_max_left'] = 1;
|
||||
}
|
||||
|
||||
$a = new stdClass();
|
||||
$a->coursename = format_string($course->shortname, true, array('context' => $coursecontext));
|
||||
$a->username = fullname($user, true);
|
||||
@ -197,16 +198,17 @@ if ($type === "usercourse.png") {
|
||||
|
||||
$rawlogs = report_log_userday($user->id, $courseselect, $daystart, $logreader);
|
||||
|
||||
if (empty($rawlogs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($rawlogs as $rawlog) {
|
||||
$logs[$rawlog->hour] = $rawlog->num;
|
||||
}
|
||||
|
||||
$graph = new graph(750, 400);
|
||||
|
||||
if (empty($rawlogs)) {
|
||||
$graph->parameter['y_axis_gridlines'] = 2;
|
||||
$graph->parameter['y_max_left'] = 1;
|
||||
}
|
||||
|
||||
$a = new stdClass();
|
||||
$a->coursename = format_string($course->shortname, true, array('context' => $coursecontext));
|
||||
$a->username = fullname($user, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user