MDL-59988 analytics: Files marked as used only if valid

- Basic unit test for minimum machine learning backends requirements
- Warning return messages now include not enough data
- Clear models when the predictions processor is changed
- Refined the name of a couple of constants / methods
This commit is contained in:
David Monllao
2017-10-13 12:24:17 +02:00
parent 9a316f3367
commit 325b3bdd8e
11 changed files with 165 additions and 34 deletions
@@ -58,6 +58,15 @@ class admin_setting_predictor extends \admin_setting_configselect {
return get_string('errorprocessornotready', 'analytics', $isready);
}
$currentvalue = get_config('analytics', 'predictionsprocessor');
if (!empty($currentvalue) && $currentvalue != str_replace('\\\\', '\\', $data)) {
// Clear all models data.
$models = \core_analytics\manager::get_all_models();
foreach ($models as $model) {
$model->clear();
}
}
return ($this->config_write($this->name, $data) ? '' : get_string('errorsetting', 'admin'));
}
}