Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 12:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Detect a change of browser tab by end user
PostPosted: September 11th, 2017, 4:22 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Is there anyway an HTML5 publications could have some code in it to detect if an end user changes to a different browser tab, or moves the focus elsewhere while running through a training course on line.

It would be helpful if I could get this information as multi-tasking while trying to complete training often leads to poor quality training and end user dissatisfaction.

Any ideas would be welcome?

Dave B

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Detect a change of browser tab by end user
PostPosted: September 11th, 2017, 9:21 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Code:
document.hasFocus()

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Detect a change of browser tab by end user
PostPosted: September 11th, 2017, 9:38 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Yes, I found a reference to that on the internet but I don't understand how it works Mack,

I presume i would put it as a java script action on each page, but how would it tell me if they have clicked on another browser? Would it return value to be saved into a variable so that I can see it in the saved data?

Bob

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Detect a change of browser tab by end user
PostPosted: September 11th, 2017, 10:00 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Just to clarify Mack, I want to know if at the end of running the timeline have they gone to another tab to do something else, or if they have gone to another tab between the end of the timeline and clicking on the "Next" button.

If the returned value is placed into a variable it would show me how many times they have gone from the training course to another programme in another tab. I don't want to know anything else other than how many times they are leaving the course and returning.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Detect a change of browser tab by end user
PostPosted: September 12th, 2017, 5:54 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Code:
//set sariables when application starts
//probably need these as publication variables if used on mutliple pages.

myCurrentState = document.hasFocus();
myChangeStateCounter = 0;


//call this function when you need to check if the state has switched.
//for example, you may use a page ticker or you could check on the timeline.
//function must be avialable on each page.

function checkState(){

//assign current state to temp variable
tmpState = document.hasFocus()

//check if current state matches previous checked state
if (myCurrentState != tmpState ){
   //if state has switched from previous, assign new state.
   myCurrentState = tmpState;
   //increment state counter to show number of changes.
   myChangeStateCounter++;
   }
}



</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Detect a change of browser tab by end user
PostPosted: September 16th, 2017, 1:16 pm 
Offline

Joined: June 26th, 2007, 11:59 am
Posts: 60
Opus: Opus 9.01
OS: Windows 7
System: Heinz 57
Thanks for posting Mack. I'm gradually working through this with some success. Now just think of the best way to run the scripts to detect the browser tab changes during the training session. Will come back again if I need some help.

_________________
Opus Pro v7, Windows XP Pro SP2, Intel Core 2 , Quad CPU Q6600 @ 2.4GHz, 1GB RAM, Partitioned HD 10 GB & 30 GB. Internet Explorer 7.


For this message DaveB56 has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group