Using a timer across multiple pages issue
September 1, 2020 12:00 AM
Hi Everyone,
I'm trying to create a reminder feature, where the learner is prompted every 40 minutes to take a break.
I've got the following objects added to my package, and whilst it performs as desired in Lectora Online preview mode, it doesn't work correctly when published to ReviewLink or my LMS. The correct behaviour is that the timer runs for 40 minutes, then when it's completed it opens a popup-page (if the variable is set to 1). What is happening when publishing is that the popup-page opens each time the learner moves to a new page.
- Title undefined OnShowPlay action object
- Play 'TakeABreakTimer' object IF VAR 'BreakRemindersEnabled' = 1 ELSE Stop 'TakeABreakTimer' object
- This should play the timer if it's stopped but only when the variable is set to 1. Otherwise, stop the timer from running (e.g. the variable is 0).
- Title undefined TakeABreakTimer timer object
- Set to Countdown, 40 minutes. AutoStart is Disabled (the timer is started by the OnShowPlay action)
- Title undefined TimerAction action object
- Done Playing 'TakeABreakTimer' Run Action Group 'TaBTimerRuntimeActions' IF VAR 'BreakRemindersEnabled' = 1 ELSE Do Nothing
- When the timer reaches 0, run the action group only if the variable is set to 1, otherwise do nothing.
- Title undefined TaBTimerRuntimeActions group - Contains 3 actions:
- OnGroupStop - Stop 'TakeABreakTimer' Always
- OnGroupDispMsg - Display Page 'Take a Break' in popup IF VAR 'BreakRemindersEnabled' = 1 ELSE Do Nothing
- OnGroupPlay - Play 'TakeABreakTimer' IF VAR 'BreakRemindersEnabled' = 1 ELSE Do Nothing
My understanding is that once OnGroupDispMsg action is run, it should then wait for the popup to be closed before running the next action OnGroupPlay - if it doesn't it's not a problem as the action shouldn't then run for another 40 minutes anyway.
It's also my understanding that if I play a timer that has finished, it should effectively restart from the 40 minutes it was set to, is that correct?
I would welcome any critique on this issue, as to whether it's my logic of the actions, or if this is a fault (as Lectora Online preview is doing one thing, which is different when published).
Thanks in advance,
P.S. Not attached are the IF statements - they are all identical. Screenshots 2-7 are zipped as limited number of file uploads.
Discussion (2)
Hi Eoin,
There seems to be an issue with playing/starting a timer in Lectora Online with an action on each page using OnShowPlay Timer action. It is setting the timer value to 0 on page switch and hence running the DonePlaying action which pops up the take-a-break page.
As a workaround for now you can set the timer to auto start and change the OnShowPlay action to OnShowStop if BreakRemindersEnabled Not Equal To 1.
The pop up page does not stop the chain of actions in the group, so you really can't have restart timer action inline with the display popup action. You could add a button in the popup page to start the timer, but then you are relying on the user to click the button to start the timer before closing the popup page.
To get around this, you can use a text block covering the entire page and have a link with an action to start the timer.
So this is what I ended up with. Please take a look and see if it'll work for you:
- Title undefined OnShowStop action : Stop TakeABreakTimer - IF BreakReminderEnabled Not Equal To 1
- Title undefined GroupResume (action group)
- OnGroupHide (action) : Hide TakeABreakText
- OnGroupPlay (action) : Play TakeABreakTimer - IF BreakReminderEnabled Not Equal To 1
- Title undefined Always on Top is Set
- "Continue" link in the text block : Run Action Group GroupResume
(you may also want to set opacity to about 90% so you can still see the page behind it)
- "Continue" link in the text block : Run Action Group GroupResume
Robert.
undefined
Thanks Robert. I haven't had a chance to test this yet, but I'll let you know how I get on.
With regards to the timer being set to 0 on each page navigation, does this seem like a fault? I know that timers within Test sections don't get reset, so I wonder why mine gets reset.
Discussions have been disabled for this post