Time on page?

joejubee
joejubee Community Member Posts: 321 ✶ Headliner ✶
Is there a way to get a time on page into a variable? (Not the time of day, a timer that counts up from 1 second, to whatever)

I was thinking of some action that started a timer, and when the user hit the next button, the contents of that timer would get written into a variable.

 

Thanks,

Joe

Comments

  • jvalley4735
    jvalley4735 Community Member Posts: 1,357
    Progress bars can be converted into timers.  Then you can say when the time was up collect the data entered in so far....

    http://trivantis.com/help/Lectora/16/ENG/Lectora_Help/index.html#2300.html
  • joejubee
    joejubee Community Member Posts: 321 ✶ Headliner ✶
    Ok - looking at the timer component of the progress bar, that seems like more of a count-down type timer.

    I'm looking for something that as soon as you hit the page, it starts counting up to an infinite number. Then, when you leave that page, the number gets set as a variable, and the count-up resets.

    But we're getting closer. :-)

    Thanks!
  • jvalley4735
    jvalley4735 Community Member Posts: 1,357
    You could reverse the numbering system so it would appear to be counting up instead of down? Or you could create a text block that changes contents every second but that would have to involve a lot of actions to keep the development within Lectora. I think th easiest way is for something to be coded in (div.time maybe?)

    @mnotermans5114 - Do you have any suggestions?
  • timk
    timk Community Member Posts: 1,176 ☆ Superstar ☆
    The progress bar timer is counting up and it has its own variable, containing the time. It can be started On:Page show and paused at any time.

    The timer object can count up or down, but its variable cannot easily be used. It can be played or paused, but it requires javascript to get the current value.

    You can build your own timer, by adding an action to the page:

    On: Timed interval
    Interval: 1 second
    Action: Modify variable
    Target: MyTimer
    Type: Add to variable
    Value: 1

    You can use a second variable to play or pause this timer, MyTimer will contain the time on the page in seconds.

    Tim
  • mnotermans5114
    mnotermans5114 Community Member Posts: 916
    I do think Tim's suggestion building a custom timer is the best way to go.

    You could create a timed action that countsup a variable at every second or any other interval. That would stop when going to the next page. The next page you however either need another variable, because i presume you want to addup all time spent on pages on the end of the course and get a total. If thats the case you might want to check the build in timers...they run over subsequent pages and thus can hold your total time.

    Regards,

    Math
  • joejubee
    joejubee Community Member Posts: 321 ✶ Headliner ✶
    Awesome! That totally works. Our reporting tool reports the total time in the course, but we're interested in the total time spent on each page, and I think this will do it.

    Thanks for all the help!

    Joe
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!