From 4463a4ae92fd9c7a243e5f4b0701c5edb59338ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Monlla=C3=B3?= Date: Tue, 24 Sep 2019 14:50:34 +0800 Subject: [PATCH] MDL-66628 tool_analytics: Effectiveness report to insights report --- .../{effectiveness_report.php => insights_report.php} | 10 +++++----- admin/tool/analytics/classes/output/models_list.php | 8 ++++---- admin/tool/analytics/classes/output/renderer.php | 8 ++++---- admin/tool/analytics/lang/en/tool_analytics.php | 4 ++-- admin/tool/analytics/model.php | 8 ++++---- ...veness_report.mustache => insights_report.mustache} | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) rename admin/tool/analytics/classes/output/{effectiveness_report.php => insights_report.php} (96%) rename admin/tool/analytics/templates/{effectiveness_report.mustache => insights_report.mustache} (90%) diff --git a/admin/tool/analytics/classes/output/effectiveness_report.php b/admin/tool/analytics/classes/output/insights_report.php similarity index 96% rename from admin/tool/analytics/classes/output/effectiveness_report.php rename to admin/tool/analytics/classes/output/insights_report.php index 906ecb7d27a..a42efa13804 100644 --- a/admin/tool/analytics/classes/output/effectiveness_report.php +++ b/admin/tool/analytics/classes/output/insights_report.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * Effectiveness report renderable. + * Insights report renderable. * * @package tool_analytics * @copyright 2019 David Monllao {@link http://www.davidmonllao.com} @@ -27,13 +27,13 @@ namespace tool_analytics\output; defined('MOODLE_INTERNAL') || die; /** - * Effectiveness report renderable. + * Insights report renderable. * * @package tool_analytics * @copyright 2019 David Monllao {@link http://www.davidmonllao.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class effectiveness_report implements \renderable, \templatable { +class insights_report implements \renderable, \templatable { /** * @var \core_analytics\model @@ -46,7 +46,7 @@ class effectiveness_report implements \renderable, \templatable { private $context = null; /** - * Inits the effectiveness report renderable. + * Inits the insights report renderable. * * @param \core_analytics\model $model * @param int|null $contextid @@ -79,7 +79,7 @@ class effectiveness_report implements \renderable, \templatable { $predictioncontexts = $this->model->get_predictions_contexts(false); if ($predictioncontexts && count($predictioncontexts) > 1) { $url = new \moodle_url('/admin/tool/analytics/model.php', ['id' => $this->model->get_id(), - 'action' => 'effectivenessreport']); + 'action' => 'insightsreport']); if ($this->context) { $selected = $this->context->id; diff --git a/admin/tool/analytics/classes/output/models_list.php b/admin/tool/analytics/classes/output/models_list.php index be1c7bae386..ade6739b2cf 100644 --- a/admin/tool/analytics/classes/output/models_list.php +++ b/admin/tool/analytics/classes/output/models_list.php @@ -288,12 +288,12 @@ class models_list implements \renderable, \templatable { } } - // Effectivity report. + // Insights report. if (!empty($anypredictionobtained) && $model->uses_insights()) { - $urlparams['action'] = 'effectivenessreport'; + $urlparams['action'] = 'insightsreport'; $url = new \moodle_url('/admin/tool/analytics/model.php', $urlparams); - $pix = new \pix_icon('i/report', get_string('effectivenessreport', 'tool_analytics')); - $icon = new \action_menu_link_secondary($url, $pix, get_string('effectivenessreport', 'tool_analytics')); + $pix = new \pix_icon('i/report', get_string('insightsreport', 'tool_analytics')); + $icon = new \action_menu_link_secondary($url, $pix, get_string('insightsreport', 'tool_analytics')); $actionsmenu->add($icon); } diff --git a/admin/tool/analytics/classes/output/renderer.php b/admin/tool/analytics/classes/output/renderer.php index 60bc2a22503..b4f7a5108e5 100644 --- a/admin/tool/analytics/classes/output/renderer.php +++ b/admin/tool/analytics/classes/output/renderer.php @@ -211,12 +211,12 @@ class renderer extends plugin_renderer_base { /** * Defer to template. * - * @param \tool_analytics\output\effectiveness_report $effectivenessreport + * @param \tool_analytics\output\insights_report $insightsreport * @return string HTML */ - protected function render_effectiveness_report(\tool_analytics\output\effectiveness_report $effectivenessreport): string { - $data = $effectivenessreport->export_for_template($this); - return parent::render_from_template('tool_analytics/effectiveness_report', $data); + protected function render_insights_report(\tool_analytics\output\insights_report $insightsreport): string { + $data = $insightsreport->export_for_template($this); + return parent::render_from_template('tool_analytics/insights_report', $data); } /** diff --git a/admin/tool/analytics/lang/en/tool_analytics.php b/admin/tool/analytics/lang/en/tool_analytics.php index 7041b83b4c7..ca3d1a271a1 100644 --- a/admin/tool/analytics/lang/en/tool_analytics.php +++ b/admin/tool/analytics/lang/en/tool_analytics.php @@ -25,6 +25,7 @@ $string['accuracy'] = 'Accuracy'; $string['actions'] = 'Actions'; $string['actionsexecutedbyusers'] = 'Actions executed by users'; +$string['actionsexecutedbyusersfor'] = 'Actions executed by users for "{$a}" model'; $string['actionexecutedgroupedusefulness'] = 'Grouped actions'; $string['allpredictions'] = 'All predictions'; $string['alltimesplittingmethods'] = 'All analysis intervals'; @@ -51,8 +52,6 @@ $string['deletemodelconfirmation'] = 'Are you sure you want to delete "{$a}"? Th $string['disabled'] = 'Disabled'; $string['editmodel'] = 'Edit "{$a}" model'; $string['edittrainedwarning'] = 'This model has already been trained. Note that changing its indicators or its analysis interval will delete its previous predictions and start generating new predictions.'; -$string['effectivenessreport'] = 'Effectiveness report'; -$string['effectivenessreportfor'] = 'Model "{$a}" effectiveness'; $string['enabled'] = 'Enabled'; $string['errorcantenablenotimesplitting'] = 'You need to select an analysis interval before enabling the model'; $string['errornoenabledandtrainedmodels'] = 'There are no enabled and trained models to predict.'; @@ -91,6 +90,7 @@ $string['indicators_help'] = 'The indicators are what you think will lead to an $string['indicators_link'] = 'Indicators'; $string['indicatorsnum'] = 'Number of indicators: {$a}'; $string['info'] = 'Info'; +$string['insightsreport'] = 'Insights report'; $string['ignoreversionmismatches'] = 'Ignore version mismatches'; $string['ignoreversionmismatchescheckbox'] = 'Ignore the differences between this site version and the original site version.'; $string['importedsuccessfully'] = 'The model has been successfully imported.'; diff --git a/admin/tool/analytics/model.php b/admin/tool/analytics/model.php index 653ab82db1e..7397de1783d 100644 --- a/admin/tool/analytics/model.php +++ b/admin/tool/analytics/model.php @@ -69,8 +69,8 @@ switch ($action) { case 'clear': $title = get_string('clearpredictions', 'tool_analytics'); break; - case 'effectivenessreport': - $title = get_string('effectivenessreport', 'tool_analytics'); + case 'insightsreport': + $title = get_string('insightsreport', 'tool_analytics'); break; case 'invalidanalysables': $title = get_string('invalidanalysables', 'tool_analytics'); @@ -282,13 +282,13 @@ switch ($action) { redirect($returnurl); break; - case 'effectivenessreport': + case 'insightsreport': $contextid = optional_param('contextid', null, PARAM_INT); echo $OUTPUT->header(); - $renderable = new \tool_analytics\output\effectiveness_report($model, $contextid); + $renderable = new \tool_analytics\output\insights_report($model, $contextid); $renderer = $PAGE->get_renderer('tool_analytics'); echo $renderer->render($renderable); diff --git a/admin/tool/analytics/templates/effectiveness_report.mustache b/admin/tool/analytics/templates/insights_report.mustache similarity index 90% rename from admin/tool/analytics/templates/effectiveness_report.mustache rename to admin/tool/analytics/templates/insights_report.mustache index c603d609de4..3b64249d0ce 100644 --- a/admin/tool/analytics/templates/effectiveness_report.mustache +++ b/admin/tool/analytics/templates/insights_report.mustache @@ -15,9 +15,9 @@ along with Moodle. If not, see . }} {{! - @template tool_analytics/effectiveness_report + @template tool_analytics/insights_report - Template for the effectiveness report. + Template for the insights report. Classes required for JS: * none @@ -39,7 +39,7 @@ }}
-

{{#str}}effectivenessreportfor, tool_analytics, {{modelname}}{{/str}}

+

{{#str}}actionsexecutedbyusersfor, tool_analytics, {{modelname}}{{/str}}

{{#contextselect}}