psychopy.org | Reference | Downloads | Github

What access we have to the computer (i.e. can we tell which operating system is being used) during the online experiment?

During the online experiment, can we know what operating system is being used? For example, can I set a rule that if the experiment is running on a mobile phone, then terminate the experiment.

In addition to the operating system, is it possible to know whether the subject is using headphone or any sound card information?

1 Like

Hi @sijiazhao, there are some suggestions here on how to detect mobile devices using code. E.g., you could use the following (but note from the link, it may not always be effective):

if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
  quitPsychoJS('Mobile device detected. Goodbye!', false)
}
1 Like

Thank @dvbridges for answering this. I also know that the operating system is shown in the output result, but it’s good to know how to block the mobile user in the way you suggested.

re: soundcard/headphone.
Just in case anyone is interested, I did some proper search and found it is hardly possible to get such information through javascript for privacy reason. There are functions which allow javascript to record via camera and headphone but it requires the users’ permission and it gets a bit too complicated for a short online experiment. I am planning to add a little questionnaire before the experiment to ask the subject to type in their headphone information instead.