Forum Discussion
Timing how long an interaction takes.
So my courses have to be timed for credit. I have an interaction which include several slides and pathways. I want to be able to make sure that the participants spend a certain amount of time going through the interaction or repeating the interaction to see different results. Is there a way to make sure an interaction takes a desired amount of time?
34 Replies
- SteveFlowersCommunity Member
All of the trigger JavaScript is saved into a file called user.js. I'll crack this and save tinkers when testing. You're right, publishing every time isn't fun
- Bernovan-SoestCommunity Member
Didn't know that. Great tip!
- SamClarkCommunity Member
I've extended Steve's code to add another variable that records elapsed seconds using the JavaScript Date() in addition to counting timer intervals. There shouldn't be much difference in the two unless other Storyline JavaScipts block the timer interval here and there. Maybe this would add up to something, maybe not, maybe accuracy doesn't matter in most situations. But using Date() doesn't cost anything additional, and you will get more accurate results.
This demo shows both counting along. You can simulate another JavaScript blocking the interval timer by clicking the "Busy" button once to view the cumulative difference.
- RebeccaFleischCCommunity Member
Steve, this is great! Thanks so much. Definitely s/b a verified answer IMHO.
I did change the Set function to when the timeline starts, and put it on the slide master. And the buttons are working. I'm contemplating making a Screenr on this at some point, with your permission, and of course referencing this thread and you, since all I did was copy and paste. But I'm thinking others might like to have this. It's beautiful! So clean. And cool that it will run between slides. Haven't looked at that part yet.
Sam, I haven't had a chance to look at yours yet. Tx for contributing.
Yeah!
- SteveFlowersCommunity Member
Sure, thing Rebecca.
I'm not sure how initializing the functions on each slide (declaring, really) will affect the slide to slide timer. Should be OK (since I think it's just declaring the functions) but I haven't tested it. If it mucks up, let me know. I'll make an adjustment that'll help.
- RebeccaFleischCCommunity Member
"...If it mucks up, let me know..." Guess I'd best get my dibs in before SL911 begins
. Tx again. Will post here if I ever get to this particular Screenr. Don't hold your breath.
- SheriNelson1Community Member
Hi,
I tried the solution and I noticed the Timer Tics falls behind the Elapsed Seconds. Anyone else had this happen?
Thanks!
Hi Sheri,
This thread is from January 2013 (hard to believe, we're in 2014!) so I'm not certain that they're still subscribed. You may want to try try sending them a PM regarding this specific solution shared, or start a new thread and share your .story file and if you modified any portions of the Javascript.
Greetings, Laura!
I'm not sure if Berno is still subscribed to this discussion, but you could always use the Contact Me button on an ELH users' profile to reach out to them directly about the shared setup.
Wishing you success with your project, and we're here if you need anything else!
- DavidFoster-3a7Community Member
Yet again a historical answer has risen up to correct a current shortcoming of Storyline. I'm so glad this was here! Cross-linked to this thread.