MDL-59212 analytics: Move API uses out of analytics dir

Part of MDL-57791 epic.
This commit is contained in:
David Monllao
2017-07-24 08:37:00 +02:00
parent 21d4ae9353
commit 206d7aa9ad
31 changed files with 218 additions and 301 deletions
+2 -2
View File
@@ -64,8 +64,8 @@ if ($hassiteconfig) {
$alltimesplittings = \core_analytics\manager::get_all_time_splittings();
$timesplittingoptions = array();
$timesplittingdefaults = array('\\core_analytics\\local\\time_splitting\\quarters_accum',
'\\core_analytics\\local\\time_splitting\\quarters', '\\core_analytics\\local\\time_splitting\\no_splitting');
$timesplittingdefaults = array('\core\analytics\time_splitting\quarters_accum',
'\core\analytics\time_splitting\quarters', '\core\analytics\time_splitting\no_splitting');
foreach ($alltimesplittings as $key => $timesplitting) {
$timesplittingoptions[$key] = $timesplitting->get_name();
}
+1 -1
View File
@@ -35,7 +35,7 @@ Options:
-h, --help Print out this help
Example:
\$ php admin/tool/models/cli/enable_model.php --modelid=1 --timesplitting=\"\\core_analytics\\local\\time_splitting\\quarters\"
\$ php admin/tool/models/cli/enable_model.php --modelid=1 --timesplitting=\"\\core\\analytics\\time_splitting\\quarters\"
";
// Now get cli options.
+1 -1
View File
@@ -39,7 +39,7 @@ Options:
-h, --help Print out this help
Example:
\$ php admin/tool/models/cli/evaluate_model.php --modelid=1 --timesplitting='\\core_analytics\\local\\time_splitting\\quarters' --filter=123,321
\$ php admin/tool/models/cli/evaluate_model.php --modelid=1 --timesplitting='\\core\\analytics\\time_splitting\\quarters' --filter=123,321
";
// Now get cli options.
-94
View File
@@ -1,94 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Tool models install function.
*
* @package tool_models
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Tool models install function.
*
* @return void
*/
function xmldb_tool_models_install() {
// Students at risk of dropping out of courses.
$target = \core_analytics\manager::get_target('\tool_models\analytics\target\course_dropout');
// Community of inquiry indicators.
$indicators = array(
'\mod_assign\analytics\indicator\cognitive_depth',
'\mod_assign\analytics\indicator\social_breadth',
'\mod_book\analytics\indicator\cognitive_depth',
'\mod_book\analytics\indicator\social_breadth',
'\mod_chat\analytics\indicator\cognitive_depth',
'\mod_chat\analytics\indicator\social_breadth',
'\mod_choice\analytics\indicator\cognitive_depth',
'\mod_choice\analytics\indicator\social_breadth',
'\mod_data\analytics\indicator\cognitive_depth',
'\mod_data\analytics\indicator\social_breadth',
'\mod_feedback\analytics\indicator\cognitive_depth',
'\mod_feedback\analytics\indicator\social_breadth',
'\mod_folder\analytics\indicator\cognitive_depth',
'\mod_folder\analytics\indicator\social_breadth',
'\mod_forum\analytics\indicator\cognitive_depth',
'\mod_forum\analytics\indicator\social_breadth',
'\mod_glossary\analytics\indicator\cognitive_depth',
'\mod_glossary\analytics\indicator\social_breadth',
'\mod_imscp\analytics\indicator\cognitive_depth',
'\mod_imscp\analytics\indicator\social_breadth',
'\mod_label\analytics\indicator\cognitive_depth',
'\mod_label\analytics\indicator\social_breadth',
'\mod_lesson\analytics\indicator\cognitive_depth',
'\mod_lesson\analytics\indicator\social_breadth',
'\mod_lti\analytics\indicator\cognitive_depth',
'\mod_lti\analytics\indicator\social_breadth',
'\mod_page\analytics\indicator\cognitive_depth',
'\mod_page\analytics\indicator\social_breadth',
'\mod_quiz\analytics\indicator\cognitive_depth',
'\mod_quiz\analytics\indicator\social_breadth',
'\mod_resource\analytics\indicator\cognitive_depth',
'\mod_resource\analytics\indicator\social_breadth',
'\mod_scorm\analytics\indicator\cognitive_depth',
'\mod_scorm\analytics\indicator\social_breadth',
'\mod_survey\analytics\indicator\cognitive_depth',
'\mod_survey\analytics\indicator\social_breadth',
'\mod_url\analytics\indicator\cognitive_depth',
'\mod_url\analytics\indicator\social_breadth',
'\mod_wiki\analytics\indicator\cognitive_depth',
'\mod_wiki\analytics\indicator\social_breadth',
'\mod_workshop\analytics\indicator\cognitive_depth',
'\mod_workshop\analytics\indicator\social_breadth',
);
array_walk($indicators, function(&$indicator) {
$indicator = \core_analytics\manager::get_indicator($indicator);
});
// We need the model to be created in order to know all its potential indicators and set them.
$model = \core_analytics\model::create($target, array());
// Course without teachers.
$target = \core_analytics\manager::get_target('\tool_models\analytics\target\no_teaching');
$timesplittingmethod = '\core_analytics\local\time_splitting\single_range';
$noteacher = \core_analytics\manager::get_indicator('\core_course\analytics\indicator\no_teacher');
\core_analytics\model::create($target, array($noteacher->get_id() => $noteacher), $timesplittingmethod);
}
-51
View File
@@ -1,51 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* tool_models plugin uninstallation.
*
* @package tool_models
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Deletes models created by tool_models
*
* @package tool_models
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function xmldb_tool_models_uninstall() {
global $DB;
// Remove the models that are using this tool targets.
$targets = core_component::get_component_classes_in_namespace('tool_models', 'analytics\target');
$options = array();
foreach ($targets as $classname => $unused) {
$target = \core_analytics\manager::get_target($classname);
$options[] = $target->get_id();
}
list($sql, $params) = $DB->get_in_or_equal($options);
$models = $DB->get_records_select('analytics_models', "target $sql", $params);
foreach ($models as $modelobj) {
$model = new \core_analytics\model($modelobj);
$model->delete();
}
}
-13
View File
@@ -30,8 +30,6 @@ $string['bettercli'] = 'To evaluate models and to get predictions are heavy proc
$string['cantguessstartdate'] = 'Can\'t guess the start date';
$string['cantguessenddate'] = 'Can\'t guess the end date';
$string['clienablemodel'] = 'You can enable the model by selecting a time splitting method by its id. Note that you can also enable it later using the web interface (\'none\' to exit)';
$string['coursenotyetstarted'] = 'The course is not yet started';
$string['coursenotyetfinished'] = 'The course is not yet finished';
$string['editmodel'] = 'Edit "{$a}" model';
$string['edittrainedwarning'] = 'This model has already been trained, note that changing its indicators or its time splitting method will delete its previous predictions and start generating the new ones';
$string['enabled'] = 'Enabled';
@@ -54,19 +52,10 @@ $string['goodmodel'] = 'This is a good model and it can be used to predict, enab
$string['indicators'] = 'Indicators';
$string['info'] = 'Info';
$string['insights'] = 'Insights';
$string['labelstudentdropoutyes'] = 'Student at risk of dropping out';
$string['labelstudentdropoutno'] = 'Not at risk';
$string['labelteachingyes'] = 'Users with teaching capabilities have access to the course';
$string['labelteachingno'] = 'No teaching';
$string['loginfo'] = 'Log extra info';
$string['modelresults'] = '{$a} results';
$string['modelslist'] = 'Models list';
$string['modeltimesplitting'] = 'Time splitting';
$string['nocourseactivity'] = 'Not enough course activity between the start and the end of the course';
$string['nocourseendtime'] = 'The course does not have an end time';
$string['nocoursesections'] = 'No course sections';
$string['nocoursestarttime'] = 'The course does not have an start time';
$string['nocoursestudents'] = 'No students';
$string['nodatatoevaluate'] = 'There is no data to evaluate the model';
$string['nodatatopredict'] = 'No new elements to get predictions for';
$string['nodatatotrain'] = 'There is no new data that can be used for training';
@@ -79,8 +68,6 @@ $string['predictionprocessfinished'] = 'Prediction process finished';
$string['samestartdate'] = 'Current start date is good';
$string['sameenddate'] = 'Current end date is good';
$string['target'] = 'Target';
$string['target:coursedropout'] = 'Students at risk of dropping out';
$string['target:noteachingactivity'] = 'No teaching';
$string['trainingprocessfinished'] = 'Training process finished';
$string['trainingresults'] = 'Training results';
$string['trainmodels'] = 'Train models';
+6 -2
View File
@@ -171,7 +171,7 @@ class manager {
$predictionprocessors = array();
foreach ($mlbackends as $mlbackend => $unused) {
$classfullpath = '\\mlbackend_' . $mlbackend . '\\processor';
$classfullpath = '\mlbackend_' . $mlbackend . '\processor';
$predictionprocessors[$classfullpath] = self::get_predictions_processor($classfullpath, false);
}
return $predictionprocessors;
@@ -389,7 +389,10 @@ class manager {
// Just in case...
$element = clean_param($element, PARAM_ALPHANUMEXT);
$classes = \core_component::get_component_classes_in_namespace('core_analytics', 'local\\' . $element);
// Core analytics classes (analytics subsystem should not contain uses of the analytics API).
$classes = \core_component::get_component_classes_in_namespace('core', 'analytics\\' . $element);
// Plugins.
foreach (\core_component::get_plugin_types() as $type => $unusedplugintypepath) {
foreach (\core_component::get_plugin_list($type) as $pluginname => $unusedpluginpath) {
$frankenstyle = $type . '_' . $pluginname;
@@ -397,6 +400,7 @@ class manager {
}
}
// Core subsystems.
foreach (\core_component::get_core_subsystems() as $subsystemname => $unusedsubsystempath) {
$componentname = 'core_' . $subsystemname;
$classes += \core_component::get_component_classes_in_namespace($componentname, 'analytics\\' . $element);
+6 -6
View File
@@ -48,7 +48,7 @@ class analytics_analysers_testcase extends advanced_testcase {
$coursecontext = \context_course::instance($course->id);
$target = new test_target_shortname();
$analyser = new \core_analytics\local\analyser\courses(1, $target, [], [], []);
$analyser = new \core\analytics\analyser\courses(1, $target, [], [], []);
$analysable = new \core_analytics\course($course);
$this->assertInstanceOf('\core_analytics\course', $analyser->get_sample_analysable($course->id));
@@ -56,7 +56,7 @@ class analytics_analysers_testcase extends advanced_testcase {
$this->assertInstanceOf('\context_course', $analyser->sample_access_context($course->id));
// Just 1 sample per course.
$class = new ReflectionClass('\core_analytics\local\analyser\courses');
$class = new ReflectionClass('\core\analytics\analyser\courses');
$method = $class->getMethod('get_all_samples');
$method->setAccessible(true);
list($sampleids, $samplesdata) = $method->invoke($analyser, $analysable);
@@ -87,7 +87,7 @@ class analytics_analysers_testcase extends advanced_testcase {
$course1context = \context_course::instance($course1->id);
$target = new test_target_shortname();
$analyser = new \core_analytics\local\analyser\site_courses(1, $target, [], [], []);
$analyser = new \core\analytics\analyser\site_courses(1, $target, [], [], []);
$analysable = new \core_analytics\site();
$this->assertInstanceOf('\core_analytics\site', $analyser->get_sample_analysable($course1->id));
@@ -96,7 +96,7 @@ class analytics_analysers_testcase extends advanced_testcase {
$this->assertInstanceOf('\context_system', $analyser->sample_access_context($course1->id));
$this->assertInstanceOf('\context_system', $analyser->sample_access_context($course3->id));
$class = new ReflectionClass('\core_analytics\local\analyser\site_courses');
$class = new ReflectionClass('\core\analytics\analyser\site_courses');
$method = $class->getMethod('get_all_samples');
$method->setAccessible(true);
list($sampleids, $samplesdata) = $method->invoke($analyser, $analysable);
@@ -142,13 +142,13 @@ class analytics_analysers_testcase extends advanced_testcase {
$ue2 = $DB->get_record('user_enrolments', array('userid' => $user2->id, 'enrolid' => $enrol->id));
$target = new test_target_shortname();
$analyser = new \core_analytics\local\analyser\student_enrolments(1, $target, [], [], []);
$analyser = new \core\analytics\analyser\student_enrolments(1, $target, [], [], []);
$analysable = new \core_analytics\course($course);
$this->assertInstanceOf('\core_analytics\course', $analyser->get_sample_analysable($ue1->id));
$this->assertInstanceOf('\context_course', $analyser->sample_access_context($ue1->id));
$class = new ReflectionClass('\core_analytics\local\analyser\student_enrolments');
$class = new ReflectionClass('\core\analytics\analyser\student_enrolments');
$method = $class->getMethod('get_all_samples');
$method->setAccessible(true);
list($sampleids, $samplesdata) = $method->invoke($analyser, $analysable);
+1 -1
View File
@@ -53,6 +53,6 @@ class test_static_target_shortname extends test_target_shortname {
* @return string
*/
public function get_analyser_class() {
return '\core_analytics\local\analyser\courses';
return '\core\analytics\analyser\courses';
}
}
+1 -1
View File
@@ -46,7 +46,7 @@ class test_target_shortname extends \core_analytics\local\target\binary {
* @return string
*/
public function get_analyser_class() {
return '\core_analytics\local\analyser\site_courses';
return '\core\analytics\analyser\site_courses';
}
/**
+8 -8
View File
@@ -59,19 +59,19 @@ class analytics_model_testcase extends advanced_testcase {
$this->assertEquals(0, $this->model->get_model_obj()->trained);
$this->assertEquals('', $this->model->get_model_obj()->timesplitting);
$this->model->enable('\\core_analytics\\local\\time_splitting\\quarters');
$this->model->enable('\core\analytics\time_splitting\quarters');
$this->assertEquals(1, $this->model->get_model_obj()->enabled);
$this->assertEquals(0, $this->model->get_model_obj()->trained);
$this->assertEquals('\\core_analytics\\local\\time_splitting\\quarters', $this->model->get_model_obj()->timesplitting);
$this->assertEquals('\core\analytics\time_splitting\quarters', $this->model->get_model_obj()->timesplitting);
}
public function test_create() {
$this->resetAfterTest(true);
$target = \core_analytics\manager::get_target('\tool_models\analytics\target\course_dropout');
$target = \core_analytics\manager::get_target('\core\analytics\target\course_dropout');
$indicators = array(
\core_analytics\manager::get_indicator('\core_analytics\local\indicator\any_write_action'),
\core_analytics\manager::get_indicator('\core_analytics\local\indicator\read_actions')
\core_analytics\manager::get_indicator('\core\analytics\indicator\any_write_action'),
\core_analytics\manager::get_indicator('\core\analytics\indicator\read_actions')
);
$model = \core_analytics\model::create($target, $indicators);
$this->assertInstanceOf('\core_analytics\model', $model);
@@ -87,8 +87,8 @@ class analytics_model_testcase extends advanced_testcase {
$this->model->init_analyser(array('evaluation' => true));
$this->assertInstanceOf('\core_analytics\local\analyser\base', $this->model->get_analyser());
$this->model->enable('\core_analytics\local\time_splitting\quarters');
$this->assertInstanceOf('\core_analytics\local\analyser\site_courses', $this->model->get_analyser());
$this->model->enable('\core\analytics\time_splitting\quarters');
$this->assertInstanceOf('\core\analytics\analyser\site_courses', $this->model->get_analyser());
}
public function test_output_dir() {
@@ -136,7 +136,7 @@ class analytics_model_testcase extends advanced_testcase {
// Wait 1 sec so the timestamp changes.
sleep(1);
$this->model->enable('\core_analytics\local\time_splitting\quarters');
$this->model->enable('\core\analytics\time_splitting\quarters');
$this->assertNotEquals($originaluniqueid, $this->model->get_unique_id());
}
+15 -15
View File
@@ -52,7 +52,7 @@ class core_analytics_prediction_testcase extends advanced_testcase {
$this->setAdminuser();
$model = $this->add_perfect_model('test_static_target_shortname');
$model->enable('\\core_analytics\\local\\time_splitting\\no_splitting');
$model->enable('\core\analytics\time_splitting\no_splitting');
$this->assertEquals(1, $model->is_enabled());
$this->assertEquals(1, $model->is_trained());
@@ -202,8 +202,8 @@ class core_analytics_prediction_testcase extends advanced_testcase {
*/
public function provider_ml_training_and_prediction() {
$cases = array(
'no_splitting' => array('\core_analytics\local\time_splitting\no_splitting', 1),
'quarters' => array('\core_analytics\local\time_splitting\quarters', 4)
'no_splitting' => array('\core\analytics\time_splitting\no_splitting', 1),
'quarters' => array('\core\analytics\time_splitting\quarters', 4)
);
// We need to test all system prediction processors.
@@ -226,9 +226,9 @@ class core_analytics_prediction_testcase extends advanced_testcase {
$this->setAdminuser();
set_config('enabled_stores', 'logstore_standard', 'tool_log');
$sometimesplittings = '\core_analytics\local\time_splitting\weekly,' .
'\core_analytics\local\time_splitting\single_range,' .
'\core_analytics\local\time_splitting\quarters';
$sometimesplittings = '\core\analytics\time_splitting\weekly,' .
'\core\analytics\time_splitting\single_range,' .
'\core\analytics\time_splitting\quarters';
set_config('timesplittings', $sometimesplittings, 'analytics');
if ($modelquality === 'perfect') {
@@ -287,10 +287,10 @@ class core_analytics_prediction_testcase extends advanced_testcase {
'ncourses' => 5,
'expectedresults' => array(
// The course duration is too much to be processed by in weekly basis.
'\core_analytics\local\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
'\core\analytics\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
// 10 samples is not enough to process anything.
'\core_analytics\local\time_splitting\single_range' => $notenoughandlowscore,
'\core_analytics\local\time_splitting\quarters' => $notenoughandlowscore,
'\core\analytics\time_splitting\single_range' => $notenoughandlowscore,
'\core\analytics\time_splitting\quarters' => $notenoughandlowscore,
)
),
'bad' => array(
@@ -298,9 +298,9 @@ class core_analytics_prediction_testcase extends advanced_testcase {
'ncourses' => 50,
'expectedresults' => array(
// The course duration is too much to be processed by in weekly basis.
'\core_analytics\local\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
'\core_analytics\local\time_splitting\single_range' => \core_analytics\model::EVALUATE_LOW_SCORE,
'\core_analytics\local\time_splitting\quarters' => \core_analytics\model::EVALUATE_LOW_SCORE,
'\core\analytics\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
'\core\analytics\time_splitting\single_range' => \core_analytics\model::EVALUATE_LOW_SCORE,
'\core\analytics\time_splitting\quarters' => \core_analytics\model::EVALUATE_LOW_SCORE,
)
),
'good' => array(
@@ -308,9 +308,9 @@ class core_analytics_prediction_testcase extends advanced_testcase {
'ncourses' => 50,
'expectedresults' => array(
// The course duration is too much to be processed by in weekly basis.
'\core_analytics\local\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
'\core_analytics\local\time_splitting\single_range' => \core_analytics\model::OK,
'\core_analytics\local\time_splitting\quarters' => \core_analytics\model::OK,
'\core\analytics\time_splitting\weekly' => \core_analytics\model::NO_DATASET,
'\core\analytics\time_splitting\single_range' => \core_analytics\model::OK,
'\core\analytics\time_splitting\quarters' => \core_analytics\model::OK,
)
)
);
+11 -11
View File
@@ -63,12 +63,12 @@ class analytics_time_splittings_testcase extends advanced_testcase {
// All core_analytics time splitting methods.
$timesplittings = array(
'\\core_analytics\\local\\time_splitting\\deciles',
'\\core_analytics\\local\\time_splitting\\deciles_accum',
'\\core_analytics\\local\\time_splitting\\no_splitting',
'\\core_analytics\\local\\time_splitting\\quarters',
'\\core_analytics\\local\\time_splitting\\quarters_accum',
'\\core_analytics\\local\\time_splitting\\single_range'
'\core\analytics\time_splitting\deciles',
'\core\analytics\time_splitting\deciles_accum',
'\core\analytics\time_splitting\no_splitting',
'\core\analytics\time_splitting\quarters',
'\core\analytics\time_splitting\quarters_accum',
'\core\analytics\time_splitting\single_range'
);
// Check that defined ranges are valid (tested through validate_ranges).
@@ -89,7 +89,7 @@ class analytics_time_splittings_testcase extends advanced_testcase {
$aug2016 = mktime(0, 0, 0, 8, 29, 2016);
// Equal parts.
$quarters = new \core_analytics\local\time_splitting\quarters();
$quarters = new \core\analytics\time_splitting\quarters();
$quarters->set_analysable($this->analysable);
$ranges = $quarters->get_all_ranges();
$this->assertCount(4, $ranges);
@@ -115,7 +115,7 @@ class analytics_time_splittings_testcase extends advanced_testcase {
$this->assertGreaterThan($aug2016, $ranges[3]['end']);
// Accumulative.
$accum = new \core_analytics\local\time_splitting\quarters_accum();
$accum = new \core\analytics\time_splitting\quarters_accum();
$accum->set_analysable($this->analysable);
$ranges = $accum->get_all_ranges();
$this->assertCount(4, $ranges);
@@ -150,9 +150,9 @@ class analytics_time_splittings_testcase extends advanced_testcase {
*/
public function test_ready_predict() {
$quarters = new \core_analytics\local\time_splitting\quarters();
$nosplitting = new \core_analytics\local\time_splitting\no_splitting();
$singlerange = new \core_analytics\local\time_splitting\single_range();
$quarters = new \core\analytics\time_splitting\quarters();
$nosplitting = new \core\analytics\time_splitting\no_splitting();
$singlerange = new \core\analytics\time_splitting\single_range();
$range = array(
'start' => time() - 100,
-12
View File
@@ -51,10 +51,6 @@ $string['errorunexistingtimesplitting'] = 'The selected time splitting method is
$string['errorunexistingmodel'] = 'Unexisting model {$a}';
$string['errorunknownaction'] = 'Unknown action';
$string['eventpredictionactionstarted'] = 'Prediction action started';
$string['indicator:accessesafterend'] = 'Accesses after the end date';
$string['indicator:accessesbeforestart'] = 'Accesses before the start date';
$string['indicator:anywrite'] = 'Any write action';
$string['indicator:readactions'] = 'Read actions amount';
$string['insightmessagesubject'] = 'New insight for "{$a->contextname}": {$a->insightname}';
$string['insightinfo'] = '{$a->insightname} - {$a->contextname}';
$string['insightinfomessage'] = 'There are some insights you may find useful. Check out {$a}';
@@ -76,14 +72,6 @@ $string['predictionsprocessor'] = 'Predictions processor';
$string['predictionsprocessor_help'] = 'Prediction processors are the machine learning backends that process the datasets generated by calculating models\' indicators and targets.';
$string['processingsitecontents'] = 'Processing site contents';
$string['successfullyanalysed'] = 'Successfully analysed';
$string['timesplitting:deciles'] = 'Deciles';
$string['timesplitting:decilesaccum'] = 'Deciles accumulative';
$string['timesplitting:nosplitting'] = 'No time splitting';
$string['timesplitting:quarters'] = 'Quarters';
$string['timesplitting:quartersaccum'] = 'Quarters accumulative';
$string['timesplitting:singlerange'] = 'Single range';
$string['timesplitting:weekly'] = 'Weekly';
$string['timesplitting:weeklyaccum'] = 'Weekly accumulative';
$string['timesplittingmethod'] = 'Time splitting method';
$string['timesplittingmethod_help'] = 'The time splitting method divides the course duration in parts, the predictions engine will run at the end of these parts. It is recommended that you only enable the time splitting methods you could be interested on using; the evaluation process will iterate through all of them so the more time splitting methods to go through the slower the evaluation process will be.';
$string['viewprediction'] = 'View prediction details';
+25
View File
@@ -336,6 +336,8 @@ $string['coursehelpnewsitemsnumber'] = 'Number of recent announcements appearing
$string['coursehelpnumberweeks'] = 'Number of sections in the course (applies to certain course formats only).';
$string['coursehelpshowgrades'] = 'Enable the display of the gradebook. It does not prevent grades from being displayed within the individual activities.';
$string['coursehidden'] = 'This course is currently unavailable to students';
$string['coursenotyetstarted'] = 'The course is not yet started';
$string['coursenotyetfinished'] = 'The course is not yet finished';
$string['courseoverviewfiles'] = 'Course summary files';
$string['courseoverviewfilesext'] = 'Course summary files extensions';
$string['courseoverviewfileslimit'] = 'Course summary files limit';
@@ -1015,8 +1017,12 @@ $string['includeroleassignments'] = 'Include role assignments';
$string['includesitefiles'] = 'Include site files used in this course';
$string['includeuserfiles'] = 'Include user files';
$string['increasesections'] = 'Increase the number of sections';
$string['indicator:accessesafterend'] = 'Accesses after the end date';
$string['indicator:accessesbeforestart'] = 'Accesses before the start date';
$string['indicator:anywrite'] = 'Any write action';
$string['indicator:completeduserprofile'] = 'User profile is completed';
$string['indicator:noteacher'] = 'There are no teachers';
$string['indicator:readactions'] = 'Read actions amount';
$string['indicator:userforumstracking'] = 'User is tracking forums';
$string['info'] = 'Information';
$string['institution'] = 'Institution';
@@ -1325,8 +1331,13 @@ $string['nextsection'] = 'Next section';
$string['no'] = 'No';
$string['noblockstoaddhere'] = 'There are no blocks that you can add to this page.';
$string['nobody'] = 'Nobody';
$string['nocourseactivity'] = 'Not enough course activity between the start and the end of the course';
$string['nocourseendtime'] = 'The course does not have an end time';
$string['nocourses'] = 'No courses';
$string['nocoursesections'] = 'No course sections';
$string['nocoursesfound'] = 'No courses were found with the words \'{$a}\'';
$string['nocoursestarttime'] = 'The course does not have an start time';
$string['nocoursestudents'] = 'No students';
$string['nocoursesyet'] = 'No courses in this category';
$string['nocomments'] = 'No comments';
$string['nodstpresets'] = 'The administrator has not enabled Daylight Savings Time support.';
@@ -1867,6 +1878,12 @@ $string['tag'] = 'Tag';
$string['tagalready'] = 'This tag already exists';
$string['tagmanagement'] = 'Add/delete tags ...';
$string['tags'] = 'Tags';
$string['target:coursedropout'] = 'Students at risk of dropping out';
$string['target:noteachingactivity'] = 'No teaching';
$string['targetlabelstudentdropoutyes'] = 'Student at risk of dropping out';
$string['targetlabelstudentdropoutno'] = 'Not at risk';
$string['targetlabelteachingyes'] = 'Users with teaching capabilities have access to the course';
$string['targetlabelteachingno'] = 'No teaching';
$string['targetrole'] = 'Target role';
$string['teacheronly'] = 'for the {$a} only';
$string['teacherroles'] = '{$a} roles';
@@ -1879,6 +1896,14 @@ If \'plain text area\' is selected, a format for text input areas such as HTML o
The list of available text editors is determined by the site administrator.';
$string['texteditor'] = 'Use standard web forms';
$string['textformat'] = 'Plain text format';
$string['timesplitting:deciles'] = 'Deciles';
$string['timesplitting:decilesaccum'] = 'Deciles accumulative';
$string['timesplitting:nosplitting'] = 'No time splitting';
$string['timesplitting:quarters'] = 'Quarters';
$string['timesplitting:quartersaccum'] = 'Quarters accumulative';
$string['timesplitting:singlerange'] = 'Single range';
$string['timesplitting:weekly'] = 'Weekly';
$string['timesplitting:weeklyaccum'] = 'Weekly accumulative';
$string['thanks'] = 'Thanks';
$string['theme'] = 'Theme';
$string['themes'] = 'Themes';
@@ -17,23 +17,23 @@
/**
* Courses analyser working at course level (insights for the course teachers).
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\analyser;
namespace core\analytics\analyser;
defined('MOODLE_INTERNAL') || die();
/**
* Courses analyser working at course level (insights for the course teachers).
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class courses extends by_course {
class courses extends \core_analytics\local\analyser\by_course {
/**
* Samples origin is course table.
@@ -17,23 +17,23 @@
/**
* Site courses analyser working at system level (insights for the site admin).
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\analyser;
namespace core\analytics\analyser;
defined('MOODLE_INTERNAL') || die();
/**
* Site courses analyser working at system level (insights for the site admin).
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class site_courses extends sitewide {
class site_courses extends \core_analytics\local\analyser\sitewide {
/**
* Samples origin is course table.
@@ -17,12 +17,12 @@
/**
* Student enrolments analyser.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\analyser;
namespace core\analytics\analyser;
defined('MOODLE_INTERNAL') || die();
@@ -33,11 +33,11 @@ require_once($CFG->dirroot . '/lib/enrollib.php');
*
* It does return all student enrolments including the suspended ones.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class student_enrolments extends by_course {
class student_enrolments extends \core_analytics\local\analyser\by_course {
/**
* @var array Cache for user_enrolment id - course id relation.
@@ -17,23 +17,23 @@
/**
* Any access after the official end of the course.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
namespace core\analytics\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Any access after the official end of the course.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class any_access_after_end extends binary {
class any_access_after_end extends \core_analytics\local\indicator\binary {
/**
* get_name
@@ -41,7 +41,7 @@ class any_access_after_end extends binary {
* @return string
*/
public static function get_name() {
return get_string('indicator:accessesafterend', 'analytics');
return get_string('indicator:accessesafterend');
}
/**
@@ -17,23 +17,23 @@
/**
* Any access before the official start of the course.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
namespace core\analytics\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Any access before the official start of the course.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class any_access_before_start extends binary {
class any_access_before_start extends \core_analytics\local\indicator\binary {
/**
* get_name
@@ -41,7 +41,7 @@ class any_access_before_start extends binary {
* @return string
*/
public static function get_name() {
return get_string('indicator:accessesbeforestart', 'analytics');
return get_string('indicator:accessesbeforestart');
}
/**
@@ -17,23 +17,23 @@
/**
* Write actions indicator.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
namespace core\analytics\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Write actions indicator.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class any_write_action extends binary {
class any_write_action extends \core_analytics\local\indicator\binary {
/**
* get_name
@@ -41,7 +41,7 @@ class any_write_action extends binary {
* @return string
*/
public static function get_name() {
return get_string('indicator:anywrite', 'analytics');
return get_string('indicator:anywrite');
}
/**
@@ -17,23 +17,23 @@
/**
* Read actions indicator.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
namespace core\analytics\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Read actions indicator.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class read_actions extends linear {
class read_actions extends \core_analytics\local\indicator\linear {
/**
* get_name
@@ -41,7 +41,7 @@ class read_actions extends linear {
* @return string
*/
public static function get_name() {
return get_string('indicator:readactions', 'analytics');
return get_string('indicator:readactions');
}
/**
@@ -17,12 +17,12 @@
/**
* Drop out course target.
*
* @package tool_models
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_models\analytics\target;
namespace core\analytics\target;
defined('MOODLE_INTERNAL') || die();
@@ -34,7 +34,7 @@ require_once($CFG->dirroot . '/completion/completion_completion.php');
/**
* Drop out course target.
*
* @package tool_models
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -46,7 +46,7 @@ class course_dropout extends \core_analytics\local\target\binary {
* @return string
*/
public static function get_name() {
return get_string('target:coursedropout', 'tool_models');
return get_string('target:coursedropout');
}
/**
@@ -87,8 +87,8 @@ class course_dropout extends \core_analytics\local\target\binary {
*/
protected static function classes_description() {
return array(
get_string('labelstudentdropoutno', 'tool_models'),
get_string('labelstudentdropoutyes', 'tool_models')
get_string('targetlabelstudentdropoutno'),
get_string('targetlabelstudentdropoutyes')
);
}
@@ -109,7 +109,7 @@ class course_dropout extends \core_analytics\local\target\binary {
* @return string
*/
public function get_analyser_class() {
return '\\core_analytics\\local\\analyser\\student_enrolments';
return '\core\analytics\analyser\student_enrolments';
}
/**
@@ -123,31 +123,31 @@ class course_dropout extends \core_analytics\local\target\binary {
global $DB;
if (!$course->was_started()) {
return get_string('coursenotyetstarted', 'tool_models');
return get_string('coursenotyetstarted');
}
if (!$students = $course->get_students()) {
return get_string('nocoursestudents', 'tool_models');
return get_string('nocoursestudents');
}
if (!course_format_uses_sections($course->get_course_data()->format)) {
// We can not split activities in time ranges.
return get_string('nocoursesections', 'tool_models');
return get_string('nocoursesections');
}
if ($course->get_start() == 0) {
// We require time start to be set.
return get_string('nocoursestarttime', 'tool_models');
return get_string('nocoursestarttime');
}
if ($course->get_end() == 0) {
// We require time end to be set.
return get_string('nocourseendtime', 'tool_models');
return get_string('nocourseendtime');
}
// Ongoing courses data can not be used to train.
if ($fortraining && !$course->is_finished()) {
return get_string('coursenotyetfinished', 'tool_models');
return get_string('coursenotyetfinished');
}
if ($fortraining) {
@@ -166,7 +166,7 @@ class course_dropout extends \core_analytics\local\target\binary {
// At least a minimum of students activity.
$nstudents = count($students);
if ($nlogs / $nstudents < 10) {
return get_string('nocourseactivity', 'tool_models');
return get_string('nocourseactivity');
}
}
@@ -17,19 +17,19 @@
/**
* No teaching target.
*
* @package tool_models
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_models\analytics\target;
namespace core\analytics\target;
defined('MOODLE_INTERNAL') || die();
/**
* No teaching target.
*
* @package tool_models
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -50,7 +50,7 @@ class no_teaching extends \core_analytics\local\target\binary {
* @return string
*/
public static function get_name() {
return get_string('target:noteachingactivity', 'tool_models');
return get_string('target:noteachingactivity');
}
/**
@@ -97,8 +97,8 @@ class no_teaching extends \core_analytics\local\target\binary {
*/
protected static function classes_description() {
return array(
get_string('labelteachingyes', 'tool_models'),
get_string('labelteachingno', 'tool_models'),
get_string('targetlabelteachingyes'),
get_string('targetlabelteachingno'),
);
}
@@ -118,7 +118,7 @@ class no_teaching extends \core_analytics\local\target\binary {
* @return string
*/
public function get_analyser_class() {
return '\\core_analytics\\local\\analyser\\site_courses';
return '\core\analytics\analyser\site_courses';
}
/**
@@ -17,23 +17,23 @@
/**
* 10 parts time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
/**
* 10 parts time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class deciles extends equal_parts {
class deciles extends \core_analytics\local\time_splitting\equal_parts {
/**
* get_name
@@ -41,7 +41,7 @@ class deciles extends equal_parts {
* @return string
*/
public function get_name() {
return get_string('timesplitting:deciles', 'analytics');
return get_string('timesplitting:deciles');
}
/**
@@ -17,23 +17,23 @@
/**
* Range processor splitting the course in ten parts and accumulating data.
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
/**
* Range processor splitting the course in ten parts and accumulating data.
*
* @package core_analytics
* @package core
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class deciles_accum extends accumulative_parts {
class deciles_accum extends \core_analytics\local\time_splitting\accumulative_parts {
/**
* get_name
@@ -41,7 +41,7 @@ class deciles_accum extends accumulative_parts {
* @return string
*/
public function get_name() {
return get_string('timesplitting:decilesaccum', 'analytics');
return get_string('timesplitting:decilesaccum');
}
/**
@@ -19,12 +19,12 @@
*
* Used when time is not a factor to consider into the equation.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
@@ -33,11 +33,11 @@ defined('MOODLE_INTERNAL') || die();
*
* Used when time is not a factor to consider into the equation.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class no_splitting extends base {
class no_splitting extends \core_analytics\local\time_splitting\base {
/**
* get_name
@@ -45,7 +45,7 @@ class no_splitting extends base {
* @return string
*/
public function get_name() {
return get_string('timesplitting:nosplitting', 'analytics');
return get_string('timesplitting:nosplitting');
}
/**
@@ -17,23 +17,23 @@
/**
* Quarters time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
/**
* Quarters time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quarters extends equal_parts {
class quarters extends \core_analytics\local\time_splitting\equal_parts {
/**
* get_name
@@ -41,7 +41,7 @@ class quarters extends equal_parts {
* @return string
*/
public function get_name() {
return get_string('timesplitting:quarters', 'analytics');
return get_string('timesplitting:quarters');
}
/**
@@ -17,23 +17,23 @@
/**
* Range processor splitting the course in quarters and accumulating data.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
/**
* Range processor splitting the course in quarters and accumulating data.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class quarters_accum extends accumulative_parts {
class quarters_accum extends \core_analytics\local\time_splitting\accumulative_parts {
/**
* get_name
@@ -41,7 +41,7 @@ class quarters_accum extends accumulative_parts {
* @return string
*/
public function get_name() {
return get_string('timesplitting:quartersaccum', 'analytics');
return get_string('timesplitting:quartersaccum');
}
/**
@@ -17,23 +17,23 @@
/**
* Single time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\time_splitting;
namespace core\analytics\time_splitting;
defined('MOODLE_INTERNAL') || die();
/**
* Single time splitting method.
*
* @package core_analytics
* @package core
* @copyright 2016 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class single_range extends base {
class single_range extends \core_analytics\local\time_splitting\base {
/**
* get_name
@@ -41,7 +41,7 @@ class single_range extends base {
* @return string
*/
public function get_name() {
return get_string('timesplitting:singlerange', 'analytics');
return get_string('timesplitting:singlerange');
}
/**
+58
View File
@@ -319,4 +319,62 @@ function xmldb_main_install() {
require_once($CFG->libdir . '/db/upgradelib.php');
make_default_scale();
make_competence_scale();
// Add built-in prediction models.
$target = \core_analytics\manager::get_target('\core\analytics\target\course_dropout');
// Community of inquiry indicators.
$indicators = array(
'\mod_assign\analytics\indicator\cognitive_depth',
'\mod_assign\analytics\indicator\social_breadth',
'\mod_book\analytics\indicator\cognitive_depth',
'\mod_book\analytics\indicator\social_breadth',
'\mod_chat\analytics\indicator\cognitive_depth',
'\mod_chat\analytics\indicator\social_breadth',
'\mod_choice\analytics\indicator\cognitive_depth',
'\mod_choice\analytics\indicator\social_breadth',
'\mod_data\analytics\indicator\cognitive_depth',
'\mod_data\analytics\indicator\social_breadth',
'\mod_feedback\analytics\indicator\cognitive_depth',
'\mod_feedback\analytics\indicator\social_breadth',
'\mod_folder\analytics\indicator\cognitive_depth',
'\mod_folder\analytics\indicator\social_breadth',
'\mod_forum\analytics\indicator\cognitive_depth',
'\mod_forum\analytics\indicator\social_breadth',
'\mod_glossary\analytics\indicator\cognitive_depth',
'\mod_glossary\analytics\indicator\social_breadth',
'\mod_imscp\analytics\indicator\cognitive_depth',
'\mod_imscp\analytics\indicator\social_breadth',
'\mod_label\analytics\indicator\cognitive_depth',
'\mod_label\analytics\indicator\social_breadth',
'\mod_lesson\analytics\indicator\cognitive_depth',
'\mod_lesson\analytics\indicator\social_breadth',
'\mod_lti\analytics\indicator\cognitive_depth',
'\mod_lti\analytics\indicator\social_breadth',
'\mod_page\analytics\indicator\cognitive_depth',
'\mod_page\analytics\indicator\social_breadth',
'\mod_quiz\analytics\indicator\cognitive_depth',
'\mod_quiz\analytics\indicator\social_breadth',
'\mod_resource\analytics\indicator\cognitive_depth',
'\mod_resource\analytics\indicator\social_breadth',
'\mod_scorm\analytics\indicator\cognitive_depth',
'\mod_scorm\analytics\indicator\social_breadth',
'\mod_survey\analytics\indicator\cognitive_depth',
'\mod_survey\analytics\indicator\social_breadth',
'\mod_url\analytics\indicator\cognitive_depth',
'\mod_url\analytics\indicator\social_breadth',
'\mod_wiki\analytics\indicator\cognitive_depth',
'\mod_wiki\analytics\indicator\social_breadth',
'\mod_workshop\analytics\indicator\cognitive_depth',
'\mod_workshop\analytics\indicator\social_breadth',
);
array_walk($indicators, function(&$indicator) {
$indicator = \core_analytics\manager::get_indicator($indicator);
});
$model = \core_analytics\model::create($target, array());
$target = \core_analytics\manager::get_target('\core\analytics\target\no_teaching');
$timesplittingmethod = '\core\analytics\time_splitting\single_range';
$noteacher = \core_analytics\manager::get_indicator('\core_course\analytics\indicator\no_teacher');
\core_analytics\model::create($target, array($noteacher->get_id() => $noteacher), $timesplittingmethod);
}