You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still, unload, beforeunload are unreliable. There's no guarantee that these will be triggered and users might complete an exercise and close the tab without the state being stored. Most content types do not use the xAPI verb completed, but answered when they are checked, so it might be a good idea to add answered as well (https://github.com/h5p/h5p-php-library/blob/master/js/h5p.js#L246). There's still that 3 seconds delay set in H5P core, so if people close the tab within 2999 milliseconds after completing an exercise the state would not be saved - but still better than it is now.
Those new triggers would only cause an AJAX request to the server if the state actually changed, because H5P checks, so these two additions should not have a performance impact server-side.
The text was updated successfully, but these errors were encountered:
If admins have set the
saveContentState
option, H5P is supposed to store the current content's state for the usersaveFreq
seconds,completed
orprogressed
unload
,beforeunload
,pagehide
event.The latter is pretty unreliable. There's no guarantee that either of those three events will fire and it may depend on the browser policy. It might help to use
visibilitychange
(https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event) in addition topagehide
. (https://github.com/h5p/h5p-php-library/blob/master/js/h5p.js#L2868 and https://github.com/h5p/h5p-php-library/blob/master/js/h5p.js#L2872)Still,
unload
,beforeunload
are unreliable. There's no guarantee that these will be triggered and users might complete an exercise and close the tab without the state being stored. Most content types do not use the xAPI verbcompleted
, butanswered
when they are checked, so it might be a good idea to addanswered
as well (https://github.com/h5p/h5p-php-library/blob/master/js/h5p.js#L246). There's still that 3 seconds delay set in H5P core, so if people close the tab within 2999 milliseconds after completing an exercise the state would not be saved - but still better than it is now.Those new triggers would only cause an AJAX request to the server if the state actually changed, because H5P checks, so these two additions should not have a performance impact server-side.
The text was updated successfully, but these errors were encountered: