MDL-64679 tool_analytics: Allow trained models to be cleared
authorDavid Monllaó <davidm@moodle.com>
Wed, 23 Jan 2019 15:20:56 +0000 (16:20 +0100)
committerDavid Monllaó <davidm@moodle.com>
Fri, 15 Feb 2019 07:43:13 +0000 (08:43 +0100)
admin/tool/analytics/classes/output/models_list.php

index cbd0a60..83e2755 100644 (file)
@@ -247,7 +247,7 @@ class models_list implements \renderable, \templatable {
             }
 
             // Clear model.
-            if (!empty($predictioncontexts)) {
+            if (!empty($predictioncontexts) || $model->is_trained()) {
                 $actionid = 'clear-' . $model->get_id();
                 $PAGE->requires->js_call_amd('tool_analytics/model', 'confirmAction', [$actionid, 'clear']);
                 $urlparams['action'] = 'clear';