mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
Merge branch 'MDL-65839_master' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
aa6a50cccc
@ -313,7 +313,8 @@ class analysis {
|
||||
}
|
||||
|
||||
try {
|
||||
$indicators = $this->analyser->get_indicators();
|
||||
// Instantiate empty indicators to ensure that no garbage is dragged from previous analyses.
|
||||
$indicators = $this->analyser->instantiate_indicators();
|
||||
foreach ($indicators as $key => $indicator) {
|
||||
// The analyser attaches the main entities the sample depends on and are provided to the
|
||||
// indicator to calculate the sample.
|
||||
|
@ -237,6 +237,18 @@ abstract class base {
|
||||
return $this->indicators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiate the indicators.
|
||||
*
|
||||
* @return \core_analytics\local\indicator\base[]
|
||||
*/
|
||||
public function instantiate_indicators() {
|
||||
foreach ($this->indicators as $key => $indicator) {
|
||||
$this->indicators[$key] = call_user_func(array($indicator, 'instance'));
|
||||
}
|
||||
return $this->indicators;
|
||||
}
|
||||
|
||||
/**
|
||||
* Samples data this analyser provides.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user