mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-66091 report_insights: Usability improvements
- More feedback provided for the user once they click on useful/notuseful from the email. - Replace the indicator calculations table headers for the table caption and replace the text by just "Indicators" - Replace "System" for the site name for insights generated at system level - Replace "$modelname prediction" for "$modelname" in report/insights/prediction.php heading MDL-66091
This commit is contained in:
parent
1c3efe48f8
commit
21202090f7
6 changed files with 34 additions and 21 deletions
|
@ -195,7 +195,8 @@ class insights_generator {
|
||||||
$actionurl = $action->get_url();
|
$actionurl = $action->get_url();
|
||||||
if (!$actionurl->get_param('forwardurl')) {
|
if (!$actionurl->get_param('forwardurl')) {
|
||||||
|
|
||||||
$actiondoneurl = new \moodle_url('/report/insights/done.php');
|
$params = ['actionvisiblename' => $action->get_text(), 'target' => '_blank'];
|
||||||
|
$actiondoneurl = new \moodle_url('/report/insights/done.php', $params);
|
||||||
// Set the forward url to the 'done' script.
|
// Set the forward url to the 'done' script.
|
||||||
$actionurl->param('forwardurl', $actiondoneurl->out(false));
|
$actionurl->param('forwardurl', $actiondoneurl->out(false));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,5 +26,18 @@ require_once(__DIR__ . '/../../config.php');
|
||||||
|
|
||||||
require_login();
|
require_login();
|
||||||
|
|
||||||
$url = new \moodle_url('/');
|
$actionvisiblename = required_param('actionvisiblename', PARAM_NOTAGS);
|
||||||
redirect($url, get_string('actionsaved', 'report_insights'), null, \core\output\notification::NOTIFY_SUCCESS);
|
|
||||||
|
$PAGE->set_pagelayout('popup');
|
||||||
|
$PAGE->set_context(\context_system::instance());
|
||||||
|
$PAGE->set_title(get_site()->fullname);
|
||||||
|
$PAGE->set_url(new \moodle_url('/report/insights/done.php'));
|
||||||
|
|
||||||
|
echo $OUTPUT->header();
|
||||||
|
|
||||||
|
$notification = new \core\output\notification(get_string('actionsaved', 'report_insights', $actionvisiblename),
|
||||||
|
\core\output\notification::NOTIFY_SUCCESS);
|
||||||
|
$notification->set_show_closebutton(false);
|
||||||
|
echo $OUTPUT->render($notification);
|
||||||
|
|
||||||
|
echo $OUTPUT->footer();
|
||||||
|
|
|
@ -103,8 +103,12 @@ if (!$model->uses_insights()) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($context->id == SYSCONTEXTID) {
|
||||||
|
$PAGE->set_heading(get_site()->shortname);
|
||||||
|
} else {
|
||||||
|
$PAGE->set_heading($insightinfo->contextname);
|
||||||
|
}
|
||||||
$PAGE->set_title($insightinfo->insightname);
|
$PAGE->set_title($insightinfo->insightname);
|
||||||
$PAGE->set_heading($insightinfo->contextname);
|
|
||||||
|
|
||||||
// Some models generate one single prediction per context. We can directly show the prediction details in this case.
|
// Some models generate one single prediction per context. We can directly show the prediction details in this case.
|
||||||
if ($model->get_analyser()::one_sample_per_analysable()) {
|
if ($model->get_analyser()::one_sample_per_analysable()) {
|
||||||
|
|
|
@ -22,11 +22,9 @@
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$string['actionsaved'] = 'Your action has been saved.';
|
$string['actionsaved'] = 'Your feedback of \'{$a}\' has been saved.';
|
||||||
$string['calculatedvalue'] = 'Calculated value';
|
|
||||||
$string['disabledmodel'] = 'Sorry, this model has been disabled by the administrator';
|
$string['disabledmodel'] = 'Sorry, this model has been disabled by the administrator';
|
||||||
$string['indicator'] = 'Indicator';
|
$string['indicators'] = 'Indicators';
|
||||||
$string['insightprediction'] = '{$a} prediction';
|
|
||||||
$string['insight'] = 'Insight';
|
$string['insight'] = 'Insight';
|
||||||
$string['insights'] = 'Insights';
|
$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['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.';
|
||||||
|
@ -39,7 +37,6 @@ $string['outcomeverypositive'] = 'Very positive outcome';
|
||||||
$string['outcomeverynegative'] = 'Very negative outcome';
|
$string['outcomeverynegative'] = 'Very negative outcome';
|
||||||
$string['pluginname'] = 'Insights';
|
$string['pluginname'] = 'Insights';
|
||||||
$string['prediction'] = 'Prediction';
|
$string['prediction'] = 'Prediction';
|
||||||
$string['predictioncalculations'] = 'Indicator calculations';
|
|
||||||
$string['predictiondetails'] = 'Prediction details';
|
$string['predictiondetails'] = 'Prediction details';
|
||||||
$string['nodetailsavailable'] = 'No prediction details are relevant.';
|
$string['nodetailsavailable'] = 'No prediction details are relevant.';
|
||||||
$string['timecreated'] = 'Time predicted';
|
$string['timecreated'] = 'Time predicted';
|
||||||
|
|
|
@ -71,8 +71,12 @@ if (!$model->uses_insights()) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($context->id == SYSCONTEXTID) {
|
||||||
|
$PAGE->set_heading(get_site()->shortname);
|
||||||
|
} else {
|
||||||
|
$PAGE->set_heading($insightinfo->contextname);
|
||||||
|
}
|
||||||
$PAGE->set_title($insightinfo->insightname);
|
$PAGE->set_title($insightinfo->insightname);
|
||||||
$PAGE->set_heading($insightinfo->contextname);
|
|
||||||
|
|
||||||
echo $OUTPUT->header();
|
echo $OUTPUT->header();
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
<h2 class="mb-2">{{#str}}insightprediction, report_insights, {{insightname}} {{/str}}</h2>
|
<h2 class="mb-2">{{insightname}}</h2>
|
||||||
<table class="generaltable insights-list">
|
<table class="generaltable insights-list">
|
||||||
{{#showpredicionheading}}
|
{{#showpredicionheading}}
|
||||||
<caption>
|
<caption>
|
||||||
|
@ -101,29 +101,23 @@
|
||||||
<caption>{{#str}}predictiondetails, report_insights{{/str}}</caption>
|
<caption>{{#str}}predictiondetails, report_insights{{/str}}</caption>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td scope="row">{{#str}}timecreated, report_insights{{/str}}</td>
|
<th scope="row">{{#str}}timecreated, report_insights{{/str}}</td>
|
||||||
<td>{{timecreated}}</td>
|
<td>{{timecreated}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{#timerange}}
|
{{#timerange}}
|
||||||
<tr>
|
<tr>
|
||||||
<td scope="row">{{#str}}timerange, report_insights{{/str}}</td>
|
<th scope="row">{{#str}}timerange, report_insights{{/str}}</td>
|
||||||
<td>{{.}}</td>
|
<td>{{.}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/timerange}}
|
{{/timerange}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table class="generaltable prediction-calculations">
|
<table class="generaltable prediction-calculations">
|
||||||
<caption class="accesshide">{{#str}}predictioncalculations, report_insights{{/str}}</caption>
|
<caption>{{#str}}indicators, report_insights{{/str}}</caption>
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th scope="col">{{#str}}indicator, report_insights{{/str}}</th>
|
|
||||||
<th scope="col">{{#str}}calculatedvalue, report_insights{{/str}}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#calculations}}
|
{{#calculations}}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="{{#style}}table-{{style}}{{/style}}">{{name}}</td>
|
<th scope="row" class="{{#style}}table-{{style}}{{/style}}">{{name}}</td>
|
||||||
<td class="{{#style}}table-{{style}}{{/style}}">{{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}}</td>
|
<td class="{{#style}}table-{{style}}{{/style}}">{{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/calculations}}
|
{{/calculations}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue