mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-66628_master' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
af59994f4f
@ -15,7 +15,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* 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;
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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.';
|
||||
|
@ -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);
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@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 @@
|
||||
}}
|
||||
|
||||
<div class="box">
|
||||
<h3>{{#str}}effectivenessreportfor, tool_analytics, {{modelname}}{{/str}}</h3>
|
||||
<h3>{{#str}}actionsexecutedbyusersfor, tool_analytics, {{modelname}}{{/str}}</h3>
|
||||
|
||||
{{#contextselect}}
|
||||
<div class="mt-3">
|
Loading…
x
Reference in New Issue
Block a user