From 7c37e56fde34e842586fbf0873b90d9128474ba7 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 28 Sep 2017 18:55:24 +0200 Subject: [PATCH] MDL-60277 report_insights: Pass the prediction as a float --- report/insights/classes/output/insight.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/report/insights/classes/output/insight.php b/report/insights/classes/output/insight.php index 51c966d034a..525129fd8f0 100644 --- a/report/insights/classes/output/insight.php +++ b/report/insights/classes/output/insight.php @@ -87,8 +87,8 @@ class insight implements \renderable, \templatable { $predictedvalue = $this->prediction->get_prediction_data()->prediction; $predictionid = $this->prediction->get_prediction_data()->id; $data->predictiondisplayvalue = $this->model->get_target()->get_display_value($predictedvalue); - list($data->style, $data->outcomeicon) = $this->get_calculation_display($this->model->get_target(), $predictedvalue, - $output); + list($data->style, $data->outcomeicon) = $this->get_calculation_display($this->model->get_target(), + floatval($predictedvalue), $output); $actions = $this->model->get_target()->prediction_actions($this->prediction, $this->includedetailsaction); if ($actions) { @@ -124,8 +124,8 @@ class insight implements \renderable, \templatable { $obj = new \stdClass(); $obj->name = call_user_func(array($calculation->indicator, 'get_name')); $obj->displayvalue = $calculation->indicator->get_display_value($calculation->value, $calculation->subtype); - list($obj->style, $obj->outcomeicon) = $this->get_calculation_display($calculation->indicator, $calculation->value, - $output, $calculation->subtype); + list($obj->style, $obj->outcomeicon) = $this->get_calculation_display($calculation->indicator, + floatval($calculation->value), $output, $calculation->subtype); $data->calculations[] = $obj; }