Tagged: ,

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #323714 Score: 0
    Profile photo of Rhys W
    Rhys W
    Member
    beginner
    intermediate
    curious george
    @Rhys

    Hi,

    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!

    #323752 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    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”.

    #323756 Score: 1
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    If you use ‘AutoStart’ it will autostart each time you visit the page. And thus reset…

    This post has received 1 vote up.
    #323757 Score: 1
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    …And if you are using the Timer object, you can make its action conditional, too.

    But if you want to RESET it, you will have to use JavaScript. Just add Lectora’s action “Run Javascript” and paste the following text: 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.
    • This reply was modified 3 years, 1 month ago by Profile photo of Sergey Snegirev Sergey Snegirev. Reason: came up with another idea
    #323758 Score: 1
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    > 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.
    #323899 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    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…

    Offcourse i could use javascript to get the currentTime….compare that to currentTime + 30 and whenever that is true…tell the user he has ran out of time…but trying to get this done without javascript….

    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 😉

    #323965 Score: 2
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    307 pts
    @timk

    Hi,

    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.

    Tim

    This post has received 2 votes up.
    Attachments:
    1. ProgressBar.zip
    #323968 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    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…

    #324072 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    336 pts
    @ssneg

    @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:
    1. Archive.zip
    #324074 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    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…

    #324733 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    @ 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…

    #324735 Score: 0
    Profile photo of Math Notermans
    Math Notermans
    Member
    contributor
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    LUC16 Attendee
    LUC16
    wise owl
    curious george
    118 pts
    @mnotermans5114

    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. 😉

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.