// run through blocks and get (unique) courses
$courses = array();
+ $totalcount = 0;
foreach ($blocks as $block) {
$courseid = $block->pageid;
if ($courseid==0) {
error( "Could not read data for courseid=$courseid" );
}
$courses[$courseid] = $course;
+ $totalcount++;
}
}
// get list of courses containing modules if required
// run through modules and get (unique) courses
$courses = array();
+ $totalcount = 0;
foreach ($modules as $module) {
$courseid = $module->course;
if ($courseid==0) {
error( "Could not read data for courseid=$courseid" );
}
$courses[$courseid] = $course;
+ $totalcount++;
}
}
else {