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:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user