Two versions shown for H5P Interactive Content

On my website I have the H5P and H5P interactive content plugin installed and I am using Moodle 4.1. When I choose Interactive Book using the H5P interactive content plugin, I do not see 'Image Hotspots' in the dropdown. In the version details I see that there are two versions for the interactive content plugin and there is no way to delete the old version. What could be the problem? 

otacke's picture

The problem could be that the respective version of "Image Hotspots" that is required by Interactive Book was not installed (properly). You could (re-)install it by uploading the demo content as an admin, but you may have to make sure to temporarily (!) set H5P into development mode by setting 

$CFG->mod_hvp_dev = 1;

in moodle's configuration file.

I have a new update regarding the issue and I hope you could help me out with it. The problem is not necessarily with only the Image Hotspots option in the Interactive Book content type, it seems like there is a version conflict as in the libraries I can see Interactive Book (9.3.1) and the latest official version is 1.7.12. When i save any new Interactive Book content type, Could not upgrade content: parameters contain the H5P.Column 1.16 while only H5P.Column 1.13 or earlier are supported.

Whenever I remove the 9.3.1 version from the library and open a new H5P activity, the library shows up again and I get the same error message. I feel like multiple H5P packages are affected and I do not want to remove the H5P activities as I would lose content and would have to upload it again. I just need to remove the 9.3.1 library removed somehow I think 

otacke's picture

Hi Uswa!

If you really have some Interactive Book that bears the version number 9.3.1, then something very odd is going on. It's possible that this is another case of some fool sharing patched content libraries and someone on your moodle instance working with admin rights when uploading someone else's H5P content - please compare https://www.olivertacke.de/labs/2024/05/02/a-short-voluntary-h5p-fire-department-story-line/ for details.

Could you please share an Interactive Book content file in that 9.3.1 version with me directly via oliver at snordian dot de - not publicly? I'd like to take a look.

I fear if there's really a 9.3.1 version of any H5P library on your platform (none has a major version of 9), then you will not be able to fix things just by removing the library, but at least some data base fixes will be required, too. One would need to investigate the situation on the moodle instance directly in order to be more specific.

Best,
Oliver

Hi Oliver,

Thank you for your response. I will send you an example h5p file via email and I am also sharing a screenshot of the error I am getting. The error message is a bit similar to the link you just shared. 

otacke's picture

Send a file, please, then maybe I can tell more.

otacke's picture

That version of Interactive Book seems to have been forked from version 1.3.1 of Interactive Book (version from January 2021).

It looks to me this fork was created to add a hardcoded custom CSS styling (found in dist/h5p_custom.css). The person who did this is either a nitwit or a lazy person, because H5P integrations provides a hook for doing this cleanly (and because that person didn't even bother to remove styles for Branching Scenario that don't have an effect in Interactive Book).

The major version of 9 was probably chosen to make this version installable without clashing with an official update (that hardly ever should reach that high major version numbers). Even if a new update with new features or bugfixes gets installed, H5P would still use the fake 9 version.

My best guess is that either your institution had someone (the nitwit or lazy person) patch Interactive Book as described above to match a custom design on your platform (red colored elements, for instance) - instead of doing it the recommended clean way, OR someone else had this been done, someone shared an H5P content file that would contain that patched version, and on your end, someone uploaded that H5P content file while having administrative rights to manage H5P libraries.

I can only repeat here what I wrote in my blog, maybe in capital letters:

  1. PLEASE, PLEASE, DO NOT CHANGE THE OFFICIAL CODE OF CONTENT TYPES ON YOUR SYSTEM IF THERE IS THE SLIGHTEST CHANCE THAT THE CONTENTS THAT USE IT CAN LEAVE THE PLATFORM. YOU MAY NOT ONLY MESS UP YOUR PLATFORM, BUT THE PLATFORM OF OTHER PEOPLE, TOO.
  2. PLEASE, DO NOT UPLOAD H5P CONTENT WITH ADMINISTRATIVE RIGHTS IF YOU’RE NOT SURE THAT IT IS FINE (OR YOU KNOW WHAT YOU’RE DOING). ON WORDPRESS, IN GENERAL, IT’S A GOOD IDEA TO SET UP AN EDITOR ACCOUNT AND NOT DO EVERYTHING WITH AN ADMIN ACCOUNT.
  3. THE FORMER TWO POINTS WILL BECOME LESS RELEVANT ONCE H5P GROUP INTRODUCES A WAY TO ENSURE THAT H5P LIBRARIES THAT ARE SUPPOSED TO BE INSTALLED ARE OFFICIAL ONES. THERE’S A SUGGESTION ON THE H5P FORUMS, FEEL FREE TO VOTE IT UP! I AM SURE THAT TOPIC IS ON THEIR AGENDA FOR THE NEW H5P HUB SERVER THAT THEY ARE PLANNING, BUT UNTIL THEN: 1. AND 2.

Given that your platform now uses the 9 version and H5P Group will most likely not raise the major version of their content type to 10, there's no other way to fix this then to make a backup, correct entries in your platform's database and hope for the best.

Sorry, don't have the time to do a full "remote tutorial" on how to do this:

  • Do a backup!
  • Find the H5P.InteractiveBook-9.3 directory on your platform and remove it. On moodle, this will require to know hot to browse moodle's file system via moodle's FileAPI.
  • Find the database table holding the H5P libraries information and change the entry with the major version of 9 for Interactive Book, so that the major version is 1.
  • Ensure that the latest version of Interactive Book is installed.
  • Upgrade all content instances to the latest version of interactive book (please cmp. https://www.olivertacke.de/labs/2024/01/13/h5p-and-not-upgrading-existing-content/)

How do we change the files in the Moodle data folder? They are hashed by moodle and if the content changes, the file needs to be moved to a different location in the data folder as the new hash of the changed content will be different to the existing hash. Is there a function in core Moodle H5P which will do this and update the database tables which used the old hash?

otacke's picture

As far as I know, there's no "moodle data explorer" tool or similar, so you will need to use moodle's File_System API directly. The function `get_local_path_from_hash` seems to be what you're looking for.

That's not a question that's specific to H5P by the way. Vou may yield better answers if you ask on the moodle forums.

Hello Otacke,

I was reccomended to speak to you about a variation of the Agammotto tool that I am trying to build or find if it currently exists - I would prefer to private message you but am unable to do so - 

Is there any way that the slider bar path that is a single horizontal slider path can be modified to have branches or offshoots off of it that those branches and offshoots can also be explored by dragging the toggle along those branches or offshoots to also display images like is done on the existing single horizontal path?

I would very much appreciate and be interested in that - I understand that there is not an option for that currently I would appreciate if you did not reply by simply respond that it isn’t currently available. I am aware of that it is not currently available. 

Is there a variation of this that is possible or do you know of anything that exists like it? What would it take to create?


I would be eternally grateful,

John

Is anyony aware of a variation of Agammotto (perhaps on another site / lms / entitiy) where the slider bar path that is a single horizontal slider path can be modified to have branches or offshoots off of it that can also be explored by dragging the toggle along these branches or offshoots to also display images like is done on the existing single horizontal path?

If not - what would it take to modify the existing Agammotto to accomdate this? I have no coding / technical background so I need quite a bit of help and explanantion here. 

I am aware that the current Agammotto tool does not allow this. Please do not reply "that currently isn't available on H5P". I can see that it isn't. That is why I am aksing the forum for additional leads / advice on how to create it or if there is a tool outside of H5P that does have that function. 

Any advice or leads would be greatly appreciated.

 

John

otacke's picture

I don't know of such a solution, but you can code "anything".

You'd need to define a data structure that allows branching, e.g. a tree instead of a linear array of image data as it is now. You may want to add an editor widget then to make editing more comfortable. A tree with just one branching node may be feasible without one, but otherwise editing would become hell. Finally, you'd have to replace the 1d slider with a 2d slider that represents the graph and uses vertical mouse movement close to a branching node to choose the right lane. Mind that you will need to come up with a decent accessible alternative for keyboard controls.

Best,

Oliver

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

Ok - this is all greek to me but is great to have for reference! Thank you for responding.  What about something like this (see image) - how complicated would this be?  Could you give me feedback on the simplest way possible to do this?

otacke's picture

That't the

Finally, you'd have to replace the 1d slider with a 2d slider that represents the graph and uses vertical mouse movement close to a branching node to choose the right lane. Mind that you will need to come up with a decent accessible alternative for keyboard controls.

Not sure what feedback you expect here. If that's your desired UX, the hardest thing probably is to determine what branch the user wants to go to based on the mouse movement. Distinguishing between left, center and right might be a little tricky to do, but maybe I am wrong here.

The rest is coding a replacement for the slider that doesn't only allow horizontal movement (1d) but also vertical movement (2) at the branching nodes.

I'd prefer to keep the "drag the toggle along the path" function to determine what branch the user went down.  That would allow a functionality / experience like a branching scenario but would allow a far more efficient and seamless and fast exploration of the path and thus the images / learning material i wanted to teach.  

otacke's picture

I didn't suggest to get rid of that functionality.

forgive me I know absolutely nothing about coding so i am not aware of what is and isn't a fair assumption about the structure.   

Are you aware of anything that is like H5Ps Agammotto on any other LMS or anything customizable like it? I really am sort of out of options to approach my project but I really do need this sort of function with the ability to put in images.  


otacke's picture

what would it take to modify the existing Agammotto to accomdate this?

You asked this.

No, I don't know any similar solution.

Please, help me to download all my H5P tasks in version 1.24 instead of the current 1.27. Our LMS(Moodle) system can't support the higher than 1.24 version and we can't work with all data created before. Please provide us possibility to use 1.24 version with links or just share with us how to solve this problem

Attachments: 
otacke's picture

If you are referring to content hosted here on h5p.org: There's no (easy) way to do this. All contents have been upgraded with the latest release and some of the new underlying library versions require H5P core 1.27. The H5P plugin on your moodle instance will need to be updated.