Difficulty programming Iowa Gambling task and presenting total sum earned
I'm trying to program a gambling experiment and am having trouble getting the monetary sum to post on screen.
Typically this is a simple task, where a summation equation that references an attribute can be programmed via in-line code.
The challenge with my experiment, however, is that I have used in-line code to run a contingent set-up. Overall what I'm trying to do is this:
Participants see 4 card choices
When they select a card, their response selection jumps to a list programmed with a schedule of rewards and losses (e.g. loss on every 10th trial in one list versus loss every 2 trials in a different list).
Using Inline code I have figured out how to make Eprime move to a separate list stored in Unreferenced objects based on distinct responses:
If DeckSlide.RESP = "1" Then
ElseIf DeckSlide.RESP = "2" Then
ElseIf DeckSlide.RESP = "3" Then
ElseIf DeckSlide.RESP = "4" Then
I used in-line code in this manner because I want Eprime to progress from top to bottom of each of these lists with every trial (e.g. the first time 1 is selected pull from row 1, the second time 1 is selected pull from row 2. the first time 2 is selected pull from row 1 of list 2).
the problem now is that if I use in line code such as the code below in my feedback slide, I get an error message.
var = c.getAttrib ("Reward")
totalsum = totalsum + var
c.SetAttrib "totalsum", totalsum
c.SetAttrib "var", var
I've read forums about the Iowa Gambling Task proposing to use a nested structure instead and a code along the lines of: Set DeckListOrder. = OffsetOrder(Asc(UCase(DeckList.RESP)) - Asc ("A") + 1) but haven't figured out how to make this work.
Does any of this make sense. Any help is much appreciated!!
Experiment available via link below: (we use a chronos button box for responses)
After working on this for weeks, I actually managed to get this working after posting this question. I've linked a working version of my Iowa Gambling Task here in case anyone can benefit from this!
Please sign in to leave a comment.