moodle-mod_hvp icon indicating copy to clipboard operation
moodle-mod_hvp copied to clipboard

JS xAPI dispatcher into Moodle events

Open nadavkav opened this issue 8 years ago • 32 comments

Add support for dispatching H5P (hvp) JS xAPI events into Moodle, and convert them into core Moodle events.

This patch is the 1st part of a larger patch which include implementing support for special (this one) hvp_xapi events on a 3rd party contrib plugin logstore_xapi that sends Moodle core events as xAPI events into a remote LRS.

nadavkav avatar Oct 12 '16 22:10 nadavkav

A lot is being done about xAPI and reporting in the release that will go out tomorrow or next week. Reports based on xAPI is added to the Drupal Quiz module, but will be added to Moodle in a later release and this Pull Request will be taken into account when these reporting capabilities are added to Moodle.

falcon-git avatar Dec 01 '16 15:12 falcon-git

Unofrtunately it might take some time before we're able to add the reporting capabilities to Moodle. Core team is extremely busy in December and January and since this PR is part of a bigger picture we can't just review it and add it the normal way.

falcon-git avatar Dec 01 '16 15:12 falcon-git

Sad to read. as it seems to me very small but important core reporting feature that could benefit other users too. I am wondering, is it such a time consuming code review that you plan to review it after January?

nadavkav avatar Dec 01 '16 20:12 nadavkav

Hi there,

I've tried to used this branch and add events in the moodle logstore. But it seem's that I always have an issue : Uncaught Error: No define call for mod_hvp/xapi-stmt-dispatcher

I've run grunt and add the code but still not working any idea ? Or better in update for sending Moodle xapi event directly to a remote LRS Espacially for a Interactive Video ?

Thanks in advance

Aldises avatar Mar 31 '17 13:03 Aldises

Details on how you can hook into the events for sending them directly to the LRS are available at https://h5p.org/documentation/x-api

icc avatar Apr 05 '17 08:04 icc

@Aldises , not sure were are you getting this error message from PHP or JS? This patch send all the xAPI JS events that happen inside the H5P player into Moodle. and inside Moodle into the mdl_logstore_standard_log (Moodle events) We have also patched a 3rd party contrib plugin logstore_xapi that sends Moodle core events as xAPI events into a remote LRS. (which is out of the scope of this patch, and is a stand alone)

nadavkav avatar Apr 05 '17 09:04 nadavkav

Is the reason for this pull request to send xAPI events to an LRS? If that is so, would it be better to skip the Moodle logs and send aggregated xAPI events directly to the LRS without storing them in Moodle?

falcon-git avatar Apr 18 '17 08:04 falcon-git

Originally, it was sending xAPI statements to an external LRS directly, but after some architecture discussions and consulting with the H2O team that developed https://github.com/xAPI-vle/moodle-logstore_xapi for Moodle (which send xAPI statement from core Moodle event to an external LRS) we thought it would be better to have the HVP module send all event first to Moodle and then let Moodle decide if it wishes to send them to and external LRS using the logstore_xapi plugin together with other core modules events.

So this patch is sending all xAPI events into Moodle's mdl_logstore_standard_log which store them as regular Moodle events and I have also patched https://github.com/xAPI-vle/moodle-logstore_xapi and added new hvp_xapi events that are sending all those events as xAPI statements (once again) into an external LRS.

I know it seems like a detour from the HVP perspective, but it is better to have Moodle manage and regulate sending the xAPI statements to an external LRS instead of individual plugins doing so. hope you agree.

nadavkav avatar Apr 18 '17 08:04 nadavkav

Ok, are you using this in production? You're not concerned about the amount of data that is being stored in Moodle? Or privacy issues? H5P will eventually generate statements for every action the user does within the H5P content.

falcon-git avatar Apr 18 '17 09:04 falcon-git

Yes. production.

I am (we are) aware of the amount of data stored in Moodle's log. (Not even considering HVP, you can imagine there are other core modules and 3rd party plugins that send their events into that log. it's a hugeeee log.) It would actually be useful if you had some kind of a LEVEL property, to control how detailed or how frequent the xAPI statements are. At the moment, even when the user is clicking the different options in a multi choice question inside Interactive Video, we save it. (even before he/she clicks the final answer). It is a very interesting learning analytics data. but indeed, a lot of it :cry:

btw, what do you mean by "Privacy issues"?

nadavkav avatar Apr 18 '17 09:04 nadavkav

Our thought regarding the amount of data is that it should be up to third party software to filter it before storing it somewhere. That is part of the reason why I'm reluctant to have H5P store it directly.

Regarding privacy, there are quite strict regulations in many countries, especially regarding children. If you store all the xAPI data H5P generates you'll know quite a lot about what the user is doing, probably more than the user thinks you'll know. Things she writes and then later deletes for instance will be stored without her knowing it. You'll also know exactly how much time she uses on everything she does, if she finds a particular part of a video interesting you'll know it etc. I think logging all this data might be in conflict with Norwegian regulations at least, but I'm no expert on this.

falcon-git avatar Apr 18 '17 11:04 falcon-git

If H5P is part of an hosting platform, it seems to me that the hosting platform should collect all the data and decide what to do with it, including forwarding it to an external LRS, if at all. all Moodle plugins report learning progress into Moodle, including grades, outcomes, completion, ... Regulating the amount of it should be a system setting, or if relevant, a course setting.

I am very much familiar with privacy law. we are required to have a privacy officer on each institute. and we have a legal department in each institute that supervise everything we do in each IT department. We are very strict with it and we have similar regulations as the Norwegian law has. as far as I am aware. all the is on premise and highly secured. We store and manage user's data for many (many) core LMS activities and also for 3rd party plugins like the H5P. For the last year or so, we are experimenting with forwarding some of the data to an external LRS, we anonymize it. when regarding Moodle, we use an adapted fork of: https://github.com/moodlehq/moodle-local_anonymise Thank you for your concerns and information regarding this!

I would like to add that using SCORM outside of simple practice is not allowed with our systems as its learning data can be easily manipulated on the client side, using the browser's console with little knowledge of JS. (that can be found on the internet). we hope the xAPI events together with the grading data sent from the H5P client into the server will set a higher level of challenge to those who try to manipulated the data. For now, important online exams are held on campus. but we are also looking into technologies that will enable us to have remote secure online exams in the near future.

nadavkav avatar Apr 19 '17 06:04 nadavkav

I see. Thank you for sharing your thoughts on this. It feels like a quite big decision to me, and we'll be talking to more Moodle users to gather more views on this before starting to store xAPI events from H5P in Moodle directly. I'm going to a Moodle Moot in May and will try to get some feedback there as well before deciding. In the meantime, I suggest that you consider creating a third party plugin that listens to the xAPI events from H5P and stores them in Moodle with or without filtering them.

Unfortunately, it is probably just as easy to manipulate xAPI data from H5P as it is for SCORM data. We will create a server-side evaluation of answers soon that will make it possible to use H5P for exams and other formal tests. In this case the js won't know the correct answer, instead, the user's answer will be matched against the correct answer server side and the score will be added to the statement on the server.

falcon-git avatar Apr 19 '17 09:04 falcon-git

Thanks you for sharing your thoughts on this. you should definitely get more use cases from other Moodle out there and event put a question at the Moodle forums, as this is a very important issue.

I just came back from the London Moodle MOOT #mootieuk17 and there was much talk presentation about H5P. your formal presence would have been appreciated a lot! I am very happy to read that you are going to one of the other MOOTs.

btw, I consider coming to your upcoming conference, thought I am interested in a much more in depth code development, if at all possible. Is there any chance for that happening during the conference or on some parallel venue?

nadavkav avatar Apr 19 '17 09:04 nadavkav

Glad to hear that you're considering to join the conference! There will be at least two core team members available on the training session "Customizing and extending H5P, for advanced users." and all seven on the hackaton on Day 2 so in both of these sessions it will be possible to join other experienced developers and go in depth. If during this time a group of people wants to carry on on day 3 as well we'll be more than happy to facilitate this and make sure at least on core team member participates in an extra hackaton :)

falcon-git avatar Apr 20 '17 08:04 falcon-git

Super cool!

nadavkav avatar Apr 20 '17 09:04 nadavkav

@nadavkav I believe this is exactly what I'm looking for! Are you still using this in production?

davidpesce avatar May 09 '17 14:05 davidpesce

Yes :smile: We also patched the logstore_xapi with 3 h5p_events.php files that is later on pushing this information to an external LRS. if you are interested... let me know. as it is not yet public on github.

nadavkav avatar May 09 '17 17:05 nadavkav

You can see it in action, if you register (free) to http://study.onl.co.il/ (use auto google translate) to view this Academic English MOOC, and them white viewing one of the Interactive H5P videos activities, open the browser's console and watch the events that are fired while you interact with H5P modules.

nadavkav avatar May 09 '17 17:05 nadavkav

@nadavkav Yes, very interested in the 3 logstore events! I'm most interested in the question set h5p content type. How do I go about getting the 3 additional events from you?

davidpesce avatar May 09 '17 17:05 davidpesce

Next week, I will clean them up and push a branch here: https://github.com/nadavkav/moodle-logstore_xapi

nadavkav avatar May 09 '17 20:05 nadavkav

@nadavkav I met with the maintainers of logstore and they're on board with me helping get things updated and enhanced. I'm digging in deep this week to get things done. If you can submit a PR with your changes, that'd be awesome! I'll add it to my weeks todo list.

davidpesce avatar May 15 '17 15:05 davidpesce

Still not finding time to get this done. hope next Sunday (we work on Sunday ;-)

nadavkav avatar May 15 '17 20:05 nadavkav

@nadavkav any chance you had some time this past Sunday?

davidpesce avatar May 23 '17 10:05 davidpesce

@nadavkav did I lose you?

davidpesce avatar Jun 05 '17 12:06 davidpesce

No. just have too much on my plate :-( A while ago, I have started a process of coordinating all the patches made by several academic campuses I work with, into a Trello board, so we can get the best code versions upstream into H5P. I have very little weekly time available to this process, and that is why it seem to take such long time, especially, considering this issue. I added you the the Trello board, so you can be more up to date with the process, as I do not want to spam this issue with unrelated discussions and mini updates :wink:

nadavkav avatar Jun 05 '17 18:06 nadavkav

@nadavkav thanks for the update (and invite to the board). Just a heads up that we are clearing out PRs in the 3 Moodle logstore sub-repositories (expander, translator, emitter) to move the code into one repository.

davidpesce avatar Jun 05 '17 19:06 davidpesce

Great move!

nadavkav avatar Jun 05 '17 19:06 nadavkav

@davidpesce @nadavkav did this ever go anywhere? Has there been any start on adding H5P support to the logstore plugin?

garemoko avatar Jan 23 '19 16:01 garemoko

@garemoko I haven't heard anything since the last posting here. :(

davidpesce avatar Jan 23 '19 18:01 davidpesce