Forum Discussion

DavidOskorus's avatar
DavidOskorus
Community Member
6 months ago

Do something once, every time a course is resumed

I'm trying to implement custom 'prompt to resume' functionality. Essentially giving the user the choice to Restart or Resume but NOT resetting all progress when the user selects Restart.

To do this, I'm setting the player to "always resume" and then adding some logic on the slide master to show a layer with a custom 'prompt to resume' dialog box.
Resume => hide layer
Restart => go to slide 1

I'm using the javascript discussed in this thread, but am running into a couple issues:

  1. I set up a variable that changes the first time the custom dialog box appears so that is doesn't continue to appear every time the page changes, but I can't get that variable to reset the next time the course resumes.
  2. document.querySelector('[data-dv_ref="resume"]') seems to only return a value of True when the player is set to "Prompt to resume" and the user selects Resume. It appears to be returning "false" when the player is set to "always resume".

Has anybody tried anything similar or have any suggestions?

Thanks!