Test PR 59 related to Interactive Book loses results when navigated away from

  • https://h5p.org/node/1092410
  • https://github.com/h5p/h5p-interactive-book/pull/59
  • I've tested the PR above hoping to benefit from Interactive Book saving the results when you navigate away and resume from where you left. 
  • Via plugin mod_hvp it works, I can even log off and log in again and it returns with proper state, but I got an error while trying to submit.
  • Via Moodle core h5pactivity, it doesn't work, if I change to another activity and comeback, it starts over the activity and on top of that, I can't submit the work as well. 
  • I've compared the current Interactive Book 1.3.1 master downloaded and build, with a new version 1.4.1 that contains the PR. 
  • The activity using the master version 1.3.1 I can submit the work not problem, the submit issue is only happening when I try to implement the PR 59 code. 
  • Detailed steps to reproduce the bug (exactly how and when did it happen)
  • Upload the h5p activities attached to install the new library "Interactive Book 1.4.1" to Moodle core h5p <moodleurl>/h5p/libraries.php. I'm attaching as well the same activity using the master "Interactive Book 1.3.1" from github.
  • 2. Platform and version number. Moodle 3.9.10 (Build: 20210913)
  • Desktop
  • Browser: Chrome and Edge
  • H5P plugin version: Moodle Core and plugin mod_hvp 1.22.3
  • See attached H5P.
  • Any browser console errors: This is the error I got when I try to submit. 
  • Any PHP errors. No.
  • Any recent changes to the environment (new plugins/modules, updates, configuration changes etc.): No
  • Any recent changes to the browser you're using (new extensions, updates etc.) No

 

Content types: 
otacke's picture

Hi!

As far as I know, the moodle core integration doesn't support the save content state feature at all (yet), so it will not work for Interactive Book or any other content type.

The code used in the pull request is running fine on a customer's platform including submission, so I am not convinced it's related to the changes - especially since the error message that you attached is not something that should be caused by the changes. It seems that Interactive Book does not properly inherit the setActivityStarted() function and the triggerXAPIScored() function. This might be an issue with H5P core (doubt that though) or potentially with the build process.

Cheers,
Oliver

otacke's picture

The problem you are experiencing may in fact be related to the building tools setup as I suggested - to the node version used in order to build the library in particular which seem to result in different output. The built library doesn't extend H5P.ContentType properly and thus lacks functions in H5P core that it is trying to call.

Should be fixed if you add to the list of modules in package.json by running

npm install --save-dev @babel/plugin-transform-classes

(or doing that manually if you prefer) and then adding

["@babel/plugin-transform-classes", { "loose": true }]

to the list of plugins in .babelrc.

Cheers,

Oliver

OK, thanks for the info regarding Moodle core h5p not supporting save content state yet. 

But the submit error is the same error I got using the plugin mod_hvp or Moodle core h5p, that's why I've reported. 

We will wait for this feature to be provided directly to Moodle via using H5P Hub in future version of Interactive book, because even if we manage to make Submit to work using a custom version of IB, that will be overriden as soon as this happens. 

Thank you again for the feedback.

otacke's picture

Hi Oswaldo!

Yes, same error across integrations - but I am very sure not related to that pull request. And yes, changes being overwritten is the dilemma if you don't fork or don't have a customized override framework (also something that the moodle core integration is lacking AFAIK) and implementation.

Best,
Oliver

BV52's picture

Hi Everyone,

Thank you for taking the time to create and test the feature of saving progress in Interactive Book. I will reach out to the person responsible for releasing updates maybe this will help expedite the process.

-BV