Millisecond Forums

Limit Web participants to only desktop machine?

https://forums.millisecond.com/Topic29141.aspx

By davidsmarch - 5/29/2020

I can't figure out if there is a way to limit people to only desktop machines. That is, I want to ensure people aren't using mobile devices. There doesn't seem to be a way to do this in the wizard (oversight), but is there in the code? I have people coming over from Prolific but there's hardly a sure way to ensure they are using desktop machines on that end and I don't want to waste money paying people whose data is useless. 

Thanks!
By Dave - 5/29/2020

davidsmarch - 5/29/2020
I can't figure out if there is a way to limit people to only desktop machines. That is, I want to ensure people aren't using mobile devices. There doesn't seem to be a way to do this in the wizard (oversight), but is there in the code? I have people coming over from Prolific but there's hardly a sure way to ensure they are using desktop machines on that end and I don't want to waste money paying people whose data is useless. 

Thanks!

You can prevent a script from running on mobile devices by using some conditional logic to trigger the script.abort() function /onexptbegin. Something like this:

<expt>
/ onexptbegin = [
if (computer.platform != "win" && computer.platform != "mac") {
script.abort();
};
]
...
</expt>

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm
https://www.millisecond.com/support/docs/v6/html/language/properties/platform.htm

Alternatively, you can also check whether the system in question has a physical keyboard, which would rule out mobile / touch-screen devices:


<expt>
/ onexptbegin = [
if (computer.haskeyboard == false) {
script.abort();
};
]
...
</expt>

https://www.millisecond.com/support/docs/v6/html/language/properties/haskeyboard.htm


By davidsmarch - 5/29/2020

Sounds like an excellent solution. I'm a first timer to Inquisit so still learning. I'm using a batch to present several different files. Where would the code you presented go within this code? 

<batch>
/ groupassignment = groupnumber
/ file = "consent.iqx"
/ file = "thr_neg_bf.iqx"
/ file = "thr_neg_ws.iqx"
/ file = "podt.iqx"
/ file = "demographics.iqx"
/ file = "debrief.iqx"
</batch>
By Dave - 5/29/2020

davidsmarch - 5/29/2020
Sounds like an excellent solution. I'm a first timer to Inquisit so still learning. I'm using a batch to present several different files. Where would the code you presented go within this code? 

<batch>
/ groupassignment = groupnumber
/ file = "consent.iqx"
/ file = "thr_neg_bf.iqx"
/ file = "thr_neg_ws.iqx"
/ file = "podt.iqx"
/ file = "demographics.iqx"
/ file = "debrief.iqx"
</batch>

I would insert a small script called e.g. "systemcheck.iqx" that just contains

<expt>
/ onexptbegin = [
if (computer.platform != "win" && computer.platform != "mac") {
script.abort(true);
};
]
</expt>

at the very start of the <batch>:


<batch>
/ groupassignment = groupnumber
/ file = "systemcheck.iqx"
/ file = "consent.iqx"
/ file = "thr_neg_bf.iqx"
/ file = "thr_neg_ws.iqx"
/ file = "podt.iqx"
/ file = "demographics.iqx"
/ file = "debrief.iqx"
</batch>

This, then, should terminate the entire batch immediately if the system is not eligible.
By davidsmarch - 5/29/2020

Dave - 5/29/2020
davidsmarch - 5/29/2020
Sounds like an excellent solution. I'm a first timer to Inquisit so still learning. I'm using a batch to present several different files. Where would the code you presented go within this code? 

<batch>
/ groupassignment = groupnumber
/ file = "consent.iqx"
/ file = "thr_neg_bf.iqx"
/ file = "thr_neg_ws.iqx"
/ file = "podt.iqx"
/ file = "demographics.iqx"
/ file = "debrief.iqx"
</batch>

I would insert a small script called e.g. "systemcheck.iqx" that just contains

<expt>
/ onexptbegin = [
if (computer.platform != "win" && computer.platform != "mac") {
script.abort(true);
};
]
</expt>

at the very start of the <batch>:


<batch>
/ groupassignment = groupnumber
/ file = "systemcheck.iqx"
/ file = "consent.iqx"
/ file = "thr_neg_bf.iqx"
/ file = "thr_neg_ws.iqx"
/ file = "podt.iqx"
/ file = "demographics.iqx"
/ file = "debrief.iqx"
</batch>

This, then, should terminate the entire batch immediately if the system is not eligible.

I'll give this a shot! Thanks for the quick and helpful replies.