Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile browser check: Exclusion does not work properly #3235

Open
RosaEmS opened this issue Feb 16, 2024 · 2 comments
Open

Mobile browser check: Exclusion does not work properly #3235

RosaEmS opened this issue Feb 16, 2024 · 2 comments

Comments

@RosaEmS
Copy link

RosaEmS commented Feb 16, 2024

Hi, I'm new to programming and use jsPsych on JATOS for my Bachelor thesis.

I ran into following problem: I use the browser plugin to check and exclude participants that use mobile devices like tablets and mobile phones.

While testing whether the study works (and so do the plugins) I ran into the following problem:

On my mobile phone, it detects the device and ends the study immediately. BUT it doesn't show the exclusion message (just a flash) and jumps right to the end page I prepared.

On a tablet, however, the study does not end immediately but rather the data is just not recorded anymore. So the participants can complete the study but no data is collected.

Below you will find the code I used for the browser-check

const mobile_check = { type: jsPsychBrowserCheck, inclusion_function: (data) => { return data.mobile === false }, exclusion_message: (data) => { if(data.mobile) { return '<p> Vielen Dank für Ihr Interesse an der Studie. <br> Das System hat erkannt, dass Sie versuchen mit einem mobilen Gerät teilzunehmen. Das ist leider nicht möglich. <br> Bitte wechseln Sie auf einen Laptop oder Computer, um die Studie bearbeiten zu können. </p>' } } };

I would be really thankful for any advice!

@jodeleeuw
Copy link
Member

Hi @RosaEmS,

The intention with the exlcusion_message parameter is that the experiment will end and display that message, so nothing else should happen. But it might be that because you are using JATOS, JATOS intercepts the end of the experiment and redirects the user.

The tablet result is odd. It might be the case that data.mobile is false for some/all tablets, so you could try and exclude off of another factor. One trick that I use when I want subjects to have a physical keyboard to complete the study is to use the html-keyboard-response plugin and have them press a key to continue. If they don't have a physical keyboard they can't do it, as the virtual keyboard won't appear.

@RosaEmS
Copy link
Author

RosaEmS commented Feb 16, 2024

Hi @jodeleeuw,

thank you so much for your fast reply. I will try to fix the issue with JATOS separately.

For the tablet issue: what confuses me is that the plugin DID catch that it was a mobile device (I can see that in the recorded results, mobile: true), but it did not stop the study altogether. The participant could end the study normally, but nothing besides the data for the device was collected. And it says that the duration was 2 seconds, even though I know it was much longer.

Any ideas?

And thanks for the tip! The main reason why we want to exclude mobile devices is due to font size, color, and design of the study. So maybe I will try another factor like minimum height or width!

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants