August 4, 2016 at 6:16 am #323714
I am trying to use the countdown timers to control some actions. The course is essentially a choose your own adventure game. Users are able to explore which can end up in them visiting pages more than once. The problem I have is when they visit a page for the second time the timers do not reset and count down again. I can’t seem to find a way to make them reset, any help would be useful!August 4, 2016 at 7:56 am #323752
How did you create the timers? If it is just an action like “Page > On Timer > 10 seconds > Do something”, just make it conditional: “Page > On Timer > 10 seconds > Do something > IF Page_0001 is NOT visited”.August 4, 2016 at 8:18 am #323756
If you use ‘AutoStart’ it will autostart each time you visit the page. And thus reset…This post has received 1 vote up.August 4, 2016 at 8:19 am #323757
…And if you are using the Timer object, you can make its action conditional, too.
testtimer3.cwObj.timerVar.set("9999999999999")(make sure the forum doesn’t break the formatting of the quotes when you copy this code) and your timer will reset to the initial state. The OnDone action of the timer will fire again at 00:00:00.
UPDATE: there is a better solution below.This post has received 1 vote up.
August 4, 2016 at 8:24 am #323758
- This reply was modified 3 years, 6 months ago by Sergey Snegirev. Reason: came up with another idea
> If you use ‘AutoStart’ it will autostart each time you visit the page. And thus reset…
Nope, it does not reset when you leave the page and return. It just keeps playing in the background*. However, your comment gave me and idea and I tested it and it works.
So.. To reset a timer, use two actions: STOP timer, PLAY timer. The former stops and resets the timer to original state and the latter plays it again. Just like stopping and playing audio files.
*technically speaking, it does not play in the background, a timer object just holds a UTC timestamp and compares current time with target time. And since time is running, the timer sort of does, too.This post has received 1 vote up.August 7, 2016 at 10:21 am #323899
I got a timer-related thing to solve too now.
Have a timer setup at the start of a range of pages ( say 15 pages as example ).
The timer is a progressbar set at 1800… increment 1 and Autostart.
So the user now has 30 minutes ( 1800 secs ) to finish the range of pages.
And now the issue comes around…
When going to a next page in the range… the timer resets and starts over…
Actually when writing this down i might have thought of a way to solve it…
– Use a timer of 30 secs or 1 minute…
– Use a decrementing variable… 60 or 30 -> going down when the timer ends…
– Retain that variable, so you have acccess to it on a new page.
– On each page start the timer again…
– This way you should more or less get a timespan of 30 minutes…
Improvements or better ideas are welcome allways 😉August 8, 2016 at 2:40 am #323965
Tim KMember328 pts@timk
there are two ways I can think of:
1. You can use a Progress Bar and store the progress in a variable between pages. Only you can’t use a “Timer” progress bar it’s got to be “Custom” and use an “On: Timed Interval” to increment / decrement the progress bar. I’ve attached an example of this solution.
2. You can put all your pages into a Test chapter. A test may contain anything, no need for questions, and you can time a test and use the normal test settings to define what happens when the time is over. Only I don’t think you can use a Progress Bar to display the time.
TimThis post has received 2 votes up.
Attachments:August 8, 2016 at 2:52 am #323968
Thx Tim… solution 1 is what im using now and works fine. The 2nd option sounds interesting too and might check that too 🙂 Thx again…August 9, 2016 at 12:53 am #324072
@mnotermans5114 I don’t understand why you have this: “When going to a next page in the range… the timer resets and starts over…”
I just checked and the timer persists across pages unless you manually stop and re-start it. I attached a sample, where a timer runs continuously on 6 pages regardless of how you navigate them back and forth.
Attachments:August 9, 2016 at 3:31 am #324074
Might be the way i set it up…or because im using 16.0.2 ( due to project limitations ) i am not sure… might dive into it at some point… thx anyway Sergey…August 17, 2016 at 10:15 pm #324733
@ sergey… your indeed correct about timers… what i actually ment… and what is reset each page… are progressbars… trying to have a progressbar showing/running elapsed time over several pages… when starting a new page… the progressbar resets…
Tims solution however works perfect…
August 17, 2016 at 10:27 pm #324735
- This reply was modified 3 years, 6 months ago by Math Notermans.
As a extra sidenote on progressbars…. trying to replicate Tim’s setup at some point i couldnot find the actions to set the Progress Bar Position…. duh…whats that…why can’t i find them ???
Appears that the list of actions is longer then my computer screen..scrolling down reveals them. 😉
You must be logged in to reply to this topic.