MDL-60631 analytics: Pass evaluation analysables filters as objects

This commit is contained in:
David Monllao 2017-10-30 10:53:30 +01:00
parent 40f1801c4b
commit 8c7db03a56
2 changed files with 9 additions and 1 deletions

View File

@ -44,7 +44,11 @@ abstract class by_course extends base {
// Default to all system courses.
if (!empty($this->options['filter'])) {
$courses = $this->options['filter'];
$courses = array();
foreach ($this->options['filter'] as $courseid) {
$courses[$courseid] = new \stdClass();
$courses[$courseid]->id = $courseid;
}
} else {
// Iterate through all potentially valid courses.
$courses = get_courses('all', 'c.sortorder ASC', 'c.id');

View File

@ -197,6 +197,10 @@ abstract class base {
$dataset = $this->calculate_indicators($sampleids, $samplesorigin, $indicators, $ranges);
if (empty($dataset)) {
return false;
}
// Now that we have the indicators in place we can add the time range indicators (and target if provided) to each of them.
$this->fill_dataset($dataset, $calculatedtarget);