Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save content state in browser local storage #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

otacke
Copy link
Contributor

@otacke otacke commented Mar 27, 2020

When users are logged in, H5P allows to store the current content state in the database. This allows students to resume their exercises where they return later. I have been asked multiple times if there was a solution that does not require users to be logged in.

When merged in, this code allows students to resume their exercises when they return without the need to be logged in. It has already been confirmed by the H5P core team that this would be a useful feature, cmp. https://h5p.org/comment/29153#comment-29153

Implementation details

  • optionally store state in browser local storage item when H5P is set to (via H5PIntegration)
  • retrieve previous state from local storage item if given, but previous state in database will take precedence (when students are logged in)
  • delete local storage item when content type is changed (same as reset for database)
  • multi-site installations are supported by having a site specific identifier in the local storage item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant