global $CFG;
$content = false;
- $assignments = NULL;
+ $assignments = array();
if (!$logs = get_records_select('log', 'time > \''.$timestart.'\' AND '.
'course = \''.$course->id.'\' AND '.
foreach ($logs as $log) {
//Create a temp valid module structure (course,id)
+ $tempmod = new object();
$tempmod->course = $log->course;
$tempmod->id = $log->info;
//Obtain the visible property from the instance
//Only if the mod is visible
if ($modvisible) {
- $assignments[$log->info] = assignment_log_info($log);
- $assignments[$log->info]->time = $log->time;
- $assignments[$log->info]->url = str_replace('&', '&', $log->url);
+ if ($info = assignment_log_info($log)) {
+ $assignments[$log->info] = $info;
+ $assignments[$log->info]->time = $log->time;
+ $assignments[$log->info]->url = str_replace('&', '&', $log->url);
+ }
}
}
- if ($assignments) {
+ if (!empty($assignments)) {
print_headline(get_string('newsubmissions', 'assignment').':');
foreach ($assignments as $assignment) {
print_recent_activity_note($assignment->time, $assignment, $assignment->name,