Skip to content
Permalink
Browse files

MDL-50833 report: Still make a chart if there are no logs

  • Loading branch information...
merrill-oakland committed Jul 14, 2015
1 parent c948f37 commit 141ce827df668f0d94d322de0cc9ed1b5fcff4c2
Showing with 10 additions and 8 deletions.
  1. +10 −8 report/log/graph.php
@@ -123,16 +123,17 @@
$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 @@
$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);

0 comments on commit 141ce82

Please sign in to comment.
You can’t perform that action at this time.