MDL-60598 analytics: Info message for predictions based on data

This commit is contained in:
David Monllao 2017-10-30 16:44:01 +01:00
parent 159b4e5d8c
commit 4a145a8ae5
3 changed files with 16 additions and 0 deletions

View File

@ -95,6 +95,11 @@ class insights_list implements \renderable, \templatable {
if ($this->model->uses_insights()) {
$predictionsdata = $this->model->get_predictions($this->context, true, $this->page, $this->perpage);
if (!$this->model->is_static()) {
$notification = new \core\output\notification(get_string('justpredictions', 'report_insights'));
$data->nostaticmodelnotification = $notification->export_for_template($output);
}
$data->predictions = array();
$predictionvalues = array();
$insights = array();

View File

@ -28,6 +28,7 @@ $string['indicator'] = 'Indicator';
$string['insightprediction'] = '{$a} prediction';
$string['insight'] = 'Insight';
$string['insights'] = 'Insights';
$string['justpredictions'] = 'Please note that the following insights are only predictions. It is not possible to predict the future with any certainty. The insights are provided so that action can be taken as necessary to prevent any negative predictions becoming reality.';
$string['outcome'] = 'Outcome';
$string['outcomenegative'] = 'Negative outcome';
$string['outcomeneutral'] = 'Neutral outcome';

View File

@ -31,6 +31,9 @@
Example context (json):
{
"insightname": "Best insight ever",
"nostaticmodelnotification": {
"message": "This is just a prediction."
},
"predictions": [
{
"predictiondisplayvalue": "This dev will understand it",
@ -73,7 +76,14 @@
{{/modelselector}}
<h2 class="m-b-2">{{{insightname}}}</h2>
{{^noinsights}}
{{#nostaticmodelnotification}}
<div class="m-t-2">
{{> core/notification_info}}
</div>
{{/nostaticmodelnotification}}
{{{ pagingbar }}}
{{#predictions}}
<table class="generaltable insights-list">