How to prevent participants from running an Inquisit experiment on mobile devices?


Author
Message
Jakob
Jakob
Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)
Group: Forum Members
Posts: 19, Visits: 62
Hi everyone,

I am trying to prevent participants from running my Inquisit experiment on mobile devices (e.g., smartphones running Android or iOS). I initially tried the following code:

<expt>
/onexptbegin = [
if (computer.os = "ios") script.abort(true);]
</expt>


However, I get the error message: 'computer.os' The expression attempts to set the value of a read-only property.

What would be the correct way to check the operating system or device type and terminate the experiment if it's running on a mobile device? I only want participants to do the script on a regular computer.

Thanks in advance for your help!

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 106K
Jakob - 2/18/2025
Hi everyone,

I am trying to prevent participants from running my Inquisit experiment on mobile devices (e.g., smartphones running Android or iOS). I initially tried the following code:

<expt>
/onexptbegin = [
if (computer.os = "ios") script.abort(true);]
</expt>


However, I get the error message: 'computer.os' The expression attempts to set the value of a read-only property.

What would be the correct way to check the operating system or device type and terminate the experiment if it's running on a mobile device? I only want participants to do the script on a regular computer.

Thanks in advance for your help!

You are using the wrong operator. You are trying to set the computer.os property to the value "ios". That cannot work, it's read-only. "=" is the assignment operator. What you need is "==", the logical comparison operator.

https://www.millisecond.com/support/docs/v6/html/language/expressions/operators.htm
Jakob
Jakob
Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)Partner Member (799 reputation)
Group: Forum Members
Posts: 19, Visits: 62
Thanks. That is an easy fix!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search