From cbf4c391c22a4f17e425771303279e3ff7d50ca5 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 27 Jul 2017 08:15:02 +0200 Subject: [PATCH] MDL-57791 analytics: Fix error message for no evaluation models --- analytics/classes/model.php | 4 ++-- lang/en/analytics.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/analytics/classes/model.php b/analytics/classes/model.php index a76acd5c096..79352cb2c27 100644 --- a/analytics/classes/model.php +++ b/analytics/classes/model.php @@ -467,8 +467,8 @@ class model { if ($this->is_static()) { $this->get_analyser()->add_log(get_string('noevaluationbasedassumptions', 'analytics')); $result = new \stdClass(); - $result->status = self::OK; - return $result; + $result->status = self::NO_DATASET; + return array($this->get_time_splitting()->get_id() => $result); } $options['evaluation'] = true; diff --git a/lang/en/analytics.php b/lang/en/analytics.php index 6ce2124c940..2dbae2cf01d 100644 --- a/lang/en/analytics.php +++ b/lang/en/analytics.php @@ -59,10 +59,11 @@ $string['insightinfomessage'] = 'The system generated some insights for you: {$a $string['insightinfomessagehtml'] = 'The system generated some insights for you: {$a}.'; $string['invalidtimesplitting'] = 'Model with id {$a} needs a time splitting method before it can be used to train'; $string['invalidanalysablefortimesplitting'] = 'It can not be analysed using {$a} time splitting method'; -$string['modeloutputdir'] = 'Models output directory'; -$string['modeloutputdirinfo'] = 'Directory where prediction processors store all evaluation info. Useful for debugging and research.'; $string['nocourses'] = 'No courses to analyse'; $string['nodata'] = 'No data available'; +$string['modeloutputdir'] = 'Models output directory'; +$string['modeloutputdirinfo'] = 'Directory where prediction processors store all evaluation info. Useful for debugging and research.'; +$string['noevaluationbasedassumptions'] = 'Models based on assumptions can not be evaluated'; $string['noinsightsmodel'] = 'This model does not generate insights'; $string['noinsights'] = 'No insights reported'; $string['nonewdata'] = 'No new data available'; -- 2.43.0