Using replace function in position parameter throws syntax error


Author
Message
ImponDeRable
ImponDeRable
Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)Partner Member (656 reputation)
Group: Forum Members
Posts: 3, Visits: 15
Hello Inquisitors!

I have a relatively simple problem but could not get my head around why my approach does not work.

Inquisit documentation gives a following example of using replace() function to get randomized picture position:

<picture mypic>
/ items = ("foo.jpg")
/ position = (replace(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100), replace(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100))
</picture>


In my experiment I use the same syntax:
<picture negpic>
/ items = neg
/ position = (replace(15, 85), 50)
</picture>

but it gives me following errors:
Element: picture.negpic
Attribute: position
Message: Setting has invalid text ', 50)'.

Element: picture.negpic
Attribute: 
Message: Expression 'replace(15,' is invalid. Unmatched parenthesis.


However, my parentheses are matched, I have also checked around
(before the definition of the picture and after) and everything seems to
be a legitimate Inquisit syntax.
I have also tried using ';' instead of ',' or adding spaces - the error is the same.

Do you have any ideas why it might not work or what should be done to fix the problem?


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: 12K, Visits: 95K
To clarify, the correct way to do this would be

<block myblock>
/ trials = [1-10=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("A")
/ hposition = replace(25%, 75%)
/ vposition = replace(10%, 50%, 90%)
</text>

or alternatively

<block myblock>
/ trials = [1-10=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("A")
/ position = (expressions.randpos, 40%)
</text>

<expressions>
/ randpos = replace(25%, 75%)
</expressions>


The syntax in your /position attribute(s) is in fact not valid, as far as I am aware.

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: 12K, Visits: 95K
I stand corrected. The functions reference does indeed give that flawed example, which I had overlooked at first. Thanks for pointing this out -- I will make sure the example gets replaced with a valid one.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search