Starting the content from where it left off
Submitted by viniw on Sun, 09/22/2024 - 14:27
Forums:
I have an lms system that I developed in React environment. I send the user data in H5P content to the lrs system with the help of xapi. I want the user to continue from where they left off in the content. How can I follow a path?
otacke
Mon, 09/23/2024 - 20:48
Permalink
When instantiating content,
When instantiating content, the `saveFreq` property of the H5PIntegration object needs to be set to a positive number. That number represents the interval in seconds that H5P core will then try to save the state in + on certain xAPI calls, cmp https://snordian.de/2023/03/04/how-does-resuming-an-exercise-work-in-h5p/.
H5P core uses the `setUserData` function in combination with the `contentUserDataAjax` function (`H5PIntegration.ajax.contentUserData` will need to hold the endpoint with proper placeholdrs) to send the state to the server. So, you will need to pick up the state and store it however you like. When instanting content, you can grab the previously stored state and pass it through to the 3rd constructor parameter.