200 Commits

Author SHA1 Message Date
David Monllaó
93663fa1a8 MDL-64783 analytics: Styles for insights sent through email 2019-04-09 00:29:57 +02:00
David Monllaó
fccc728fcc MDL-64783 analytics: Performance improvements
- Removed redundant query to analytics_predict_samples
- Analysers API now uses recordsets to iterate through the analysable
  elements. They take the last analysed time into account.
- New method for targets so there is no need to always update the last
  analysis time. Useful for lightweight targets.
2019-04-09 00:29:57 +02:00
David Monllaó
20d7f527b0 MDL-64783 analytics: Discern prediction actions on insights generation 2019-04-09 00:29:51 +02:00
David Monllaó
9f690999ec MDL-64783 analytics: Performance improvements and internal refactoring
The base classes analyser and time-splitting method had too many
reponsibilities. A new analysis class has been created.
2019-04-09 00:26:39 +02:00
David Monllaó
bb7dccdb8e MDL-64783 analytics: Insights generation logic out of the target 2019-04-09 00:26:39 +02:00
David Monllaó
e85c2f372b MDL-64783 analytics: Improvements to the insights system 2019-04-09 00:26:23 +02:00
David Monllaó
50935afba4 MDL-64783 analytics: Upcoming activities due and related API changes 2019-04-09 00:25:24 +02:00
Eloy Lafuente (stronk7)
481c1ae4ce Merge branch 'MDL-64779_master' of git://github.com/dmonllao/moodle 2019-04-02 23:23:13 +02:00
Eloy Lafuente (stronk7)
ed7fa60946 Merge branch 'MDL-61667-master-modelsinstall' of git://github.com/mudrd8mz/moodle 2019-04-02 00:20:47 +02:00
David Monllaó
f54a4092c7 MDL-61667 analytics: Remove duplicated capability checks
\core_analytics\model::create and \core_analytics\model::enable methods
are called from install/upgrade scripts. Therefore, they should not
include any capability check. Their capability checks are actually
redundant, as the user capabilities are already checked in the
entry-point scripts.
2019-04-01 14:57:57 +02:00
David Mudrák
d887b0c7f7 MDL-61667 analytics: Fix coding style issues in the existing code
These coding style issues were spotted while working on the issue. No
real changes here, just the coding style fixes attached to the patchset
for convenience.
2019-04-01 14:23:06 +02:00
David Mudrák
606c3be0f6 MDL-61667 analytics: Create missing models on install/upgrade
Similarly to how the scheduled tasks work, we now automatically check
and make sure that all the models specified in the component's
db/analytics.php file exist during the installation or upgrade of the
component.
2019-04-01 14:23:06 +02:00
David Mudrák
aa8af6fcfc MDL-61667 analytics: Fix checking that a given model does not exist
The original implementation did not work well for checking that the
given model does NOT exist. If no record was found in the
analytics_models table, the code execution continued and it reached the
moment when indicators were checked. If no indicators were provided, the
call ended up with error 'array_keys() expects parameter 1 to be array,
boolean given' (because indicators were set to false).
2019-04-01 14:23:06 +02:00
David Mudrák
3b7c7918f3 MDL-61667 analytics: Deprecate the add_builtin_models() method
The functionality of the \core_analytics\manager::add_builtin_models()
method is to be replaced with automatic update of models provided by the
core moodle component. There is no need to call this method explicitly
any more. Instead, adding new models will be done by updating the
lib/db/analytics.php file and bumping the core version.
2019-04-01 14:23:06 +02:00
David Mudrák
6187213f39 MDL-61667 analytics: Add method to actually create a declared model
This is simply a wrapper around the model's create() method that works
with the model declaration syntax from the db/analytics.php file.
2019-04-01 14:23:06 +02:00
David Mudrák
f05840451e MDL-61667 analytics: Add methods to read and validate model declarations
Allow every component to declare prediction models it provides via the
db/analytics.php file.
2019-04-01 14:23:06 +02:00
David Mudrák
4de4d1652b MDL-61667 analytics: Don't autoenable models with time splitting defined
When the API had originally been designed, it was assumed that the
presence of the time splitting method implies no requirement for the
machine learning backend and that it is a sign of less performance
demanding models. So it seemed to be safe and useful to have such models
automatically enabled. That assumption did not prove to be valid. Most
of the time is spent calculating indicators that depend on log tables.

We realized it would be useful to be able to specify the default time
splitting method without the need to have such models auto-enabled.
2019-04-01 14:23:06 +02:00
David Monllaó
75dfc588b5 MDL-64779 tool_analytics: Export selector 2019-04-01 13:56:37 +02:00
Jun Pataleta
db3527c2cc Merge branch 'MDL-63906_master' of git://github.com/dmonllao/moodle 2019-04-01 10:32:10 +08:00
Tom Dickman
0d6a45d2fe MDL-64284 core: improved performance of component class searching
Added static caching of classes to reduce load times and reduce calls to `get_component_classes`
by altering to accept a null component value to search classmap only once.
2019-03-29 11:44:43 +11:00
David Mudrák
c679d39c36 MDL-64996 analytics: Don't mark static model as untrained after clearing
Static predictions models (i.e. those using a target based on
assumptions, not facts) are always considered as trained. Clearing them
must not mark them as untrained. Doing so would make them being skipped
by the prediction scheduled task.
2019-03-25 08:56:11 +01:00
Adrian Greeve
b1869131cf Merge branch 'MDL-60936_master' of git://github.com/dmonllao/moodle 2019-03-20 14:50:46 +08:00
David Monllaó
3576b66bfd MDL-60936 analytics: Timesplittings setting only for evaluation 2019-03-18 09:34:52 +01:00
David Monllaó
0bd52bfdac MDL-63906 analytics: Release the lock on \Throwable received 2019-03-15 15:48:27 +01:00
David Monllaó
ead38829bf MDL-65085 analytics: noreply user sends insights 2019-03-15 13:48:57 +01:00
Adrian Greeve
fa50232ff7 Merge branch 'MDL-64477-master-lastats' of git://github.com/mudrd8mz/moodle 2019-03-12 13:36:43 +08:00
David Mudrák
5e9b091248 MDL-64477 analytics: Introduce a new \core_analytics\stats class
The purpose of the class is to provide stats and meta data about how the
analytics is used on the site.
2019-03-11 10:23:25 +01:00
David Monllaó
e97dfff78d MDL-64787 tool_analytics: Include training data source in the log table 2019-03-07 20:44:48 +01:00
David Monllaó
bc82b89586 MDL-64787 mlbackend: Evaluate trained models 2019-03-07 20:43:30 +01:00
David Monllaó
74823933c8 MDL-64787 tool_analytics: UI for trained models evaluation 2019-03-07 20:43:30 +01:00
David Monllaó
c70a7194f4 MDL-60944 analytics: Include trained ML models 2019-02-26 10:58:41 +01:00
David Monllaó
e4453adc55 MDL-60944 tool_analytics: Adding create and delete features
Extra modifications to refine the preexisting patch.
2019-02-25 09:54:07 +01:00
Ankit Agarwal
349c44128d MDL-60944 analytics: Add base support for import / export 2019-02-25 09:54:07 +01:00
David Monllao
e0c889978f MDL-64320 analytics: Validate discrete indicators separately 2019-01-30 12:11:08 +01:00
David Monllao
d9c54de37f Merge branch 'MDL-63700-master' of git://github.com/mickhawkins/moodle 2018-11-05 11:13:51 +01:00
Michael Hawkins
1170b1e0aa MDL-63700 core_analytics: Add support for removal of context users
This issue is a part of the MDL-62560 Epic.
2018-10-31 13:40:51 +08:00
Eloy Lafuente (stronk7)
bd5fdcfccd MDL-63422 general: review core loop / switch / case / continue
This commit reviews all continue uses in core happening within a
loop / switch / case hierarchy. This does not cover:

- Changes to libraries. Will be handled in another issue / commit.
- Uses out from loops, will be reviewed by other commit.

The policy followed has been:
- When possible, take rid of the continue.
- When clearly the intention was to jump to next element in loop
  change to continue 2
- When it was not clear, keep old behavior switching to break, no
  matter how weird the behavior may be.
2018-10-31 00:17:59 +01:00
David Monllao
d44ce97fe1 MDL-60520 analytics: Do not block model updates if the backend is down 2018-10-22 13:58:33 +02:00
David Monllao
ed12ba6ba8 MDL-60520 analytics: Per-model ml backend 2018-10-22 13:58:33 +02:00
David Monllao
70e8515ea8 MDL-62218 analytics: Add missing sample origin checking 2018-05-04 16:35:42 +02:00
David Monllao
97b0a6cbfc MDL-62218 analytics: Privacy API implementation 2018-05-03 15:28:22 +02:00
David Monllao
63f2c0c664 MDL-61154 analytics: No escaping for text format url 2018-03-16 09:27:07 +01:00
Ankit Agarwal
fabe98ac92 MDL-60861 analytics: Enabling a model requires timesplitting 2017-12-11 10:47:01 +05:30
sam marshall
a938e4096c MDL-60174 core_dml: fix miscellaneous incorrect recordset usage
The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
2017-11-27 11:10:33 +00:00
Ankit Agarwal
05ba0b9574 MDL-60796 analytics: Fix phpdoc issues 2017-11-14 12:33:46 +05:30
Sara Arjona
0c0d460e8b MDL-60718 analytics: Avoid duplicates for users with 2 enrolments 2017-11-08 19:12:59 +01:00
David Monllao
76f98c3bd5 MDL-59256 analytics: Move get_activities method to CoI scope
CoI = community of inquiry model
2017-11-07 08:14:49 +01:00
Damyon Wiese
5dbd051502 Merge branch 'MDL-59950_master' of git://github.com/dmonllao/moodle 2017-11-02 14:39:32 +08:00
David Monllao
8c7db03a56 MDL-60631 analytics: Pass evaluation analysables filters as objects 2017-10-30 10:54:07 +01:00
David Monllao
db9d745c7b MDL-59950 analytics: Add constants for cognitive and social levels 2017-10-27 10:48:38 +02:00