MDL-59988 analytics: Reset trained status on clear

This commit is contained in:
David Monllao
2017-10-18 07:02:23 +02:00
parent f150071901
commit 0af2421acd
2 changed files with 31 additions and 9 deletions
+22 -6
View File
@@ -150,9 +150,17 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso
}
if ($exitcode != 0) {
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
if (!empty($resultobj->errors)) {
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
} else if (!empty($resultobj->info)) {
// Show info if no errors are returned.
$errors = $resultobj->info;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
}
$resultobj->info = array(get_string('errorpredictionsprocessor', 'analytics', $errors));
}
@@ -195,9 +203,17 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso
}
if ($exitcode != 0) {
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
if (!empty($resultobj->errors)) {
$errors = $resultobj->errors;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
} else if (!empty($resultobj->info)) {
// Show info if no errors are returned.
$errors = $resultobj->info;
if (is_array($errors)) {
$errors = implode(', ', $errors);
}
}
$resultobj->info = array(get_string('errorpredictionsprocessor', 'analytics', $errors));
}