expressions to values


Author
Message
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: 105K
plush - Monday, March 20, 2017
Dear Inquisit wizards,

I have a value (doping = 0) that I later need in my script to use as input. To calculate this value I use an expression (values.doping = round(expressions.iat_doping_d*100). However, the doping-value isn't updated.

The expression itself is a number and one that I see it saved in the data. I therefore do not expect the problem to be about the expression itself, but in how it is used to replace the doping-value.

Suggestions are much appreciated!

Best and thanks,

Tom

----------------------------------------------------------

<values>
/ doping = 0
</values>

<trial doping_summary>
/ stimulustimes = [0=doping_summary]
/ validresponse = (" ")
/ recorddata = false
/ ontrialbegin = [values.doping = round(expressions.iat_doping_d*100)]
</trial>

<text doping_summary>
/ items = ("Your score was <% values.doping %>.")
/ size = (60%, 60%)
/ hjustify = left
</text>


There is nothing obviously wrong with the code you posted and -- as far as I can tell -- it works with an arbitrary expression:

<values>
/ doping = 0
</values>

<trial doping_summary>
/ stimulustimes = [0=doping_summary]
/ validresponse = (" ")
/ recorddata = false
/ ontrialbegin = [values.doping = round(expressions.iat_doping_d*100)]
</trial>

<text doping_summary>
/ items = ("Your score was <% values.doping %>.")
/ size = (60%, 60%)
/ hjustify = left
</text>

<expressions>
/ iat_doping_d = rand(-2,2)
</expressions>

So I suspect I does have something to do with your particular expression. Regardless, instead of using a value, why don't you use the expressions directly in your <text> element, i.e.

<text doping_summary>
/ items = ("Your score was <% expressions.iat_doping_d*100 %>.")
/ size = (60%, 60%)
/ hjustify = left
</text>

or

<text doping_summary>
/ items = ("Your score was <% round(expressions.iat_doping_d*100) %>.")
/ size = (60%, 60%)
/ hjustify = left
</text>


plush
plush
Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)Guru (5.4K reputation)
Group: Forum Members
Posts: 57, Visits: 96
Dear Inquisit wizards,

I have a value (doping = 0) that I later need in my script to use as input. To calculate this value I use an expression (values.doping = round(expressions.iat_doping_d*100). However, the doping-value isn't updated.

The expression itself is a number and one that I see it saved in the data. I therefore do not expect the problem to be about the expression itself, but in how it is used to replace the doping-value.

Suggestions are much appreciated!

Best and thanks,

Tom

----------------------------------------------------------

<values>
/ doping = 0
</values>

<trial doping_summary>
/ stimulustimes = [0=doping_summary]
/ validresponse = (" ")
/ recorddata = false
/ ontrialbegin = [values.doping = round(expressions.iat_doping_d*100)]
</trial>

<text doping_summary>
/ items = ("Your score was <% values.doping %>.")
/ size = (60%, 60%)
/ hjustify = left
</text>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search