How to disable Analytics compeletely

How to disable Analytics compeletely

by Randy Thornton -
Number of replies: 15
Picture of Documentation writers

I have a client who needs to disable the Analytics completely for certain legal reasons related to student privacy. I want to verify what all needs to be done.


A) Disable processing

There seems to be no master setting to turn this on and off like other tools, such as Badges or Competencies or Messaging. There is no setting in Site admin > Analytics for this either.

So, is the only way to do this either to:

1) Disable each Model in its Action menu > Disable, and/or

2) To turn off the various Scheduled tasks related to this, which seems to be three:  Predict models, Train models, and Analytics cleanup.

3) Disable this for any users other than admins to re-enable. Are there any capabilities other than moodle/analytics:managemodels and moodle/analytics:listinsights that are involved?


AND

B) Remove any existing data

How do I remove any and all previous data processing that may have taken place before we turn those off?

There are nine database tables with table names starting with _analytics_ so are these the only tables used? Some of these are obviously setting tables and can remain but any related to data collected need to be emptied.

And are there any directories used for storage other than the one set in the Models output directory (eg. pathto/moodledata/moodle/models)


Anything else?


Will there be a master switch to turn this off in Moodle 3.5? If not I would suggest so and that it may be off by default too. Just assuming that it is ok to start such processing on site without regard to what legal or privacy issues may be present would not be good.

Thanks

Randy





Average of ratings: -
In reply to Randy Thornton

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers

Just wanted to add that the site is currently in 3.4 and since we added the plugins to it ourselves, obviously we were aware of how it was set and wanted to test it out.

However, we don't want either to uninstall right now or have to deal with it again in 3.5 later.

So, how will the upgrade to 3.5 will handle this? I hope it will retain all the various settings in the 3.4 plugins....

In reply to Randy Thornton

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers

Never mind, actually, the production site was upgraded from 3.3 to 3.4 without the plugins, so we got those in 3.4 anyway. 

We had added the plugins to a test 3.3 site before but it was discarded not upgraded. So we have no issue going from 3.4 to 3.5 when it comes out.


The answer though would be pertinent to anyone else who added the plugins to 3.3 then was planning on upgrading to 3.4. 

In reply to Randy Thornton

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers

For lack of ability to take this code from core without having to figure that out every future upgrade, my clients have decided to drop Moodle altogether and move to another platform.

Average of ratings: Useful (1)
In reply to Randy Thornton

Re: How to disable Analytics compeletely

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

That's really sad sad

I think you should really create a tracker item to ask for the creation of a global switch to (dis)allow analytics. And/or an option in config.php file.

I really don't understand why, for such an important thing, it hasn't been made and for sure i'll vote for it!

Séverin

In reply to Séverin Terrier

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers


Séverin,

You are right about that. For such an important tool I would have expected a whole set of management tools, especially given the potential legal issues, including the ability to remove it and/or any data associated with it.

I am going to answer the issue more fully in the post in the other forum.

Randy



In reply to Séverin Terrier

Re: How to disable Analytics compeletely

by David Monllaó -

Hi Séverin

We didn't add a global disable button because all models that can be controversial (privacy, performance intensive...) are disabled by default, that is effectively the same as disabling a plugin. The analytics tool is just a list of models.

Average of ratings: Useful (1)
In reply to Séverin Terrier

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers


Séverin,

I think both your ideas are very good, especially the idea of a switch in the config file. I will follow up soon with a post on some other suggestions I have for how this should be made secure. I'll be happy to follow up with trackers after the dust settles from discussion.

Randy

In reply to Randy Thornton

Re: How to disable Analytics compeletely

by David Monllaó -

Hi Randy,

A) No, there is no setting. Disabling all models should be enough. All models that can be controversial (privacy, performance intensive...) are disabled by default, the same for future models. We had a delete model action but we ended up removing it during review the outcome is not very different from disabling a model. It is also ok to #2 and #3.

B) You have a 'Clear predictions' button

Average of ratings: Useful (2)
In reply to Randy Thornton

Re: How to disable Analytics compeletely

by David Monllaó -

I understand from your words that you explicitly enabled students at risk model (it is disabled by default) and your client wasn't happy with that. If that is the case you just need to disable the model and clear predictions.

In reply to David Monllaó

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers


David,

Right, thanks for your replies. I can see how that may seem to be, but actually the situation was rather different. The client was unhappy because they were no longer able to uninstall Analytics after it changed from plugin to core.

So, to give some background, we installed in 3.3 as a plugin, trained and figured out how it works. Very nice. No problem. Then the client, for certain business and legal reasons, required it to be completely uninstalled. Ok. No problem. 

Then in 3.4 this is no longer an installable plugin; it is not even an internal plugin; it can no longer be uninstalled. Now we have a problem.

We suggested and tested many alternatives, but in the end, removing the code from core was the only way to comply and that would have meant managing a custom code based for multiple sites for years. That was not a viable alternative here.

"Moodle is Modular. Until it isn't." as one person involved in this said to me. Having it modular, a true plugin, would give people an option of removing it if they need, but having it tightly in core takes that away, or at least makes it very difficult (expensive) to do.

Hope that provides some context about this. I will follow up elsewhere on some other thoughts on this subject.

Thanks,

Randy



In reply to Randy Thornton

Re: How to disable Analytics compeletely

by Elizabeth Dalton -

Randy, I don't know your client's legal needs, obviously. I'm surprised that the existence of a feature in Moodle caused them to drop Moodle altogether, even though the feature does nothing unless sub-components (models) are manually enabled. Since this is such a concern for your client, I feel I should point out that most LMS software includes fairly extensive logging (and if hosted by a provider, you have little idea of what they are doing with those logs).

If a switch to disable the Moodle Learning Analytics feature is required for many Moodle users and/or clients, I encourage someone from the Moodle community to post a tracker ticket describing how you expect it to work and what visibility (if any) needs to be provided to site administrators, users, managers, etc. It will be best if someone who has an identified need writes the request, so we can be sure your needs are identified, though I'm happy to help with clarifications.


In reply to Elizabeth Dalton

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers


Elizabeth,

I know, I was really surprised too, but I learned a lot.

This is probably an edge case for most people in Moodle right now, but consider that there are some really complicated business relations revolving around who owns what rights to what data. User data is bought and sold and so contracts can have constraints on what clients can collect and do with it. Add in GDPR and federal data laws like in Germany and Switzerland and it gets complicated.

It's not just raw data, but also analytics rights. You might be interested in the situation where a content provider wanted contractual rights to the analytics for their products and they wanted to prevent a certain competitor from getting those rights too. We even tried to sketch out how to divide things up. It was really unusual.

Another interesting thing that came up was consent (in the GDPR sense) for previous training data for users long finished with courses. In order to do the training for the model, we needed to use the old courses - but had consent for that been given? Was it included under the "compatible" use clause? Was that data supposed to have been removed as no longer needed? I mean, lots of questions.


I have a list of proposed settings for the admin part of this and I will post them in a bit. I am happy to put in all the trackers for this when time comes.


Randy


In reply to Randy Thornton

Re: How to disable Analytics compeletely

by David Monllaó -

Hi Randy,

I think it is important to clarify some ideas because some of your statements are not very correct.

tool_analytics plugin can be uninstalled, if you uninstall it no analytics will run, tool_analytics it is a proper plugin and it does not go against the Moodle is modular. I am sorry if you have external restrictions that block you from uninstalling the plugin, but it may be better to avoid mixing up concepts because this gets confusing for an external reader that has no idea about how things really work.

The whole analytics thing was designed keeping in mind that people could not be interested in using it. In that case people just need to uninstall tool_analytics. Feel free to create an issue to add a global disable setting, that would also work. The analytics engine is what it can not be uninstalled and that is perfectly fine, it does nothing by itself, it is a set of APIs called by tool_analytics; summary: if no tool_analytics no analytics smile This does not go either against "Moodle is modular"; the current architecture (as well as the plugin + APIs separation) is exactly what allows us to make Moodle analytics 100% modular (more info in https://docs.moodle.org/dev/Communication_Between_Components).

Average of ratings: Useful (3)
In reply to David Monllaó

Re: How to disable Analytics compeletely

by Randy Thornton -
Picture of Documentation writers


David, 

You are of course correct when you say tool_analytics is a plugin, but it is a certain kind. I stand by what I said above, however. I think we are just using the word "plugin" in different ways. So I will try to be more precise here and please correct me if I am mistaken.

In 3.3, Inspire is installed as an "additional plugin" and if you go to the 'Manage admin plugins' menu to uninstall it, it will remove all the parts: the Inspire plugin in admin tools, the predictors, and the model in the Report menu, and all menu entries and all settings.

In 3.4, Analytics was changed to no longer be an additional plugin but is part core and part core plugin. Now tool_analytics is a "core plugin" and can be removed from the plugin overview page, but the rest of Analytics is not and therefore as you said can't be uninstalled: the menus and settings are still there.

It's as if I awoke one morning to find someone driving around my lawn in a car. I yell at them, "Hey, quit driving around tearing up my lawn!" and the guy says, "Ok" and drives away. The next morning I wake up to find the car sitting in the middle of my lawn. I yell, "Hey, didn't you hear what I said?" And he says, "Don't worry I removed the engine! It can't tear up your lawn any more".

What the client wants is the car off their lawn, engine or no engine. 

With the change from 3.3 additional plugin to 3.4 style, you can't remove the car from the lawn anymore. It's no longer an additional type plugin you can fully uninstall. That's what my clients mean when they said, "Moodle is modular. Until it isn't." It's not a statement about architecture, it's a statement of the how features are managed. How the components communicate doesn't mean anything to them, but having things they can't uninstall means a lot.

In general, there's a lot of issues with uninstalling core plugins, one of which is they will get reinstalled next upgrade and then you have to uninstall them again. If you need to reinstall them for some reason, that's a complex process of under the hood work to re-add core code from the git repos, a process only for experienced admins. Core plugins bring a lot of complications to managing things if you uninstall them and that should certainly be avoided unless it is the only possible option to solve a problem. Managing them is very different from managing additional plugins.

To sum up, If Analytics in 3.4 were still an additional plugin as it was in 3.3, I could simply uninstall and reinstall it easily like any additional plugin. You can not fully uninstall in 3.4 what you could fully uninstall in 3.3.

So, I hope this is a more accurate description of how it works and the difference between 3.3 and 3.4 that we went through.

Randy