Creating an experiment with multiple buttons that can only be selected one time each


Creating an experiment with multiple buttons that can only be selected...
Author
Message
ejn528
ejn528
Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)Associate Member (57 reputation)
Group: Forum Members
Posts: 4, Visits: 4
I am trying to create an implementation of the Automatic Balloon Analogue Risk Task (autoBART) using buttons instead of a text box to collect responses from the participants. I am new to inquisit and have been unable to complete this task.

The goal is to have 50 buttons on the screen (representing 1-50 pumps) and allow users to select how many pumps they desire, with each selection only being available once. So if they choose 30 pumps the first trial, that button will disappear for trial 2, and this will continue as they select from the remaining buttons.


I have a prototype that works, with 50 buttons that dictate the amount of pumps for the balloon, however I am not able to take options away in subsequent trials after they have been selected. So a participant could select the same number of pumps for every trial. This is what I am trying to prevent.

I hoped the solution would be found in lists, in theory I would have 3 lists: one master list of all buttons: "list.allbuttons", one list of unselected buttons: "list.unselected", which would contain all buttons at the start of the experiment, then as each button is selected the respective button would be removed from "list.unselected", and added to the third list: "list.selected".

This is not proving to be possible for several reasons:
First, lists behavior seems to only allow for a random selection of one of the items at a time, not all of the items.
Secondly, trial /validresponse does not take a list as a valid option, giving error message: "Could not locate element list.allpumpbuttons.items". All variations of list referencing that I tried throw a similar error

I am thinking if not lists, perhaps using values to accomplish this would work, but honestly I am at a loss and just need some guidance.

I have created this prototype by editing the autoBART task downloaded from Inquisit. I am providing only chunks of my script below for brevity sake, but it should make it clear how I have implemented my experiment. If more code is needed I will happily provide it.


****
Button Creation
****

<button pump1>
/ caption = "1"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (16%, 20%)
</button>

<button pump2>
/ caption = "2"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (16%, 25%)
</button>

<button pump3>
/ caption = "3"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (16%, 30%)
</button>

<button pump4>
/ caption = "4"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (16%, 35%)
</button>

<button pump5>
/ caption = "5"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (16%, 40%)
</button>

<button pump6>
/ caption = "6"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (24%, 20%)
</button>

<button pump7>
/ caption = "7"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (24%, 25%)
</button>

<button pump8>
/ caption = "8"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (24%, 30%)
</button>

<button pump9>
/ caption = "9"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (24%, 35%)
</button>

<button pump10>
/ caption = "10"
/ fontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ size = (8%, 5%)
/ position = (24%, 40%)
</button>

//continues from button pump11 to button pump50//

***
List Creation
***
<list allbuttons>
/ items = (button.pump1, button.pump2, button.pump3, button.pump4, button.pump5, button.pump6, button.pump7, button.pump8, button.pump9. button.pump10,
button.pump11, button.pump12, button.pump13, button.pump14, button.pump15, button.pump16, button.pump17, button.pump18, button.pump19. button.pump20,
button.pump21, button.pump22, button.pump23, button.pump24, button.pump25, button.pump26, button.pump27, button.pump28, button.pump29. button.pump30,
button.pump31, button.pump32, button.pump33, button.pump34, button.pump35, button.pump36, button.pump37, button.pump38, button.pump39. button.pump40,
button.pump41, button.pump42, button.pump43, button.pump44, button.pump45, button.pump46, button.pump47, button.pump48, button.pump49. button.pump50)
/ replace = false
/ selectionmode = random
/ selectionrate = always
</list>

<list unselected>
/ items = (button.pump1, button.pump2, button.pump3, button.pump4, button.pump5, button.pump6, button.pump7, button.pump8, button.pump9. button.pump10,
button.pump11, button.pump12, button.pump13, button.pump14, button.pump15, button.pump16, button.pump17, button.pump18, button.pump19. button.pump20,
button.pump21, button.pump22, button.pump23, button.pump24, button.pump25, button.pump26, button.pump27, button.pump28, button.pump29. button.pump30,
button.pump31, button.pump32, button.pump33, button.pump34, button.pump35, button.pump36, button.pump37, button.pump38, button.pump39. button.pump40,
button.pump41, button.pump42, button.pump43, button.pump44, button.pump45, button.pump46, button.pump47, button.pump48, button.pump49. button.pump50)
/ replace = false
/ selectionmode = random
/ selectionrate = always
</list>

<list selected>
/ items = ()
/ replace = false
/ selectionmode = random
/ selectionrate = always
</list>

***
Trial which collects wantedpumps
***
<trial pumpinput>
/ stimulustimes = [0=balloon, totalearnings, pumpcount, potentialearnings, ballooncount, pumpcount, pumpinputinstruct1, wantedpumps;
10 = pump1, pump2, pump3, pump4, pump5,
pump6, pump7, pump8, pump9, pump10,
pump11, pump12, pump13, pump14, pump15,
pump16, pump17, pump18, pump19, pump20,
pump21, pump22, pump23, pump24, pump25,
pump26, pump27, pump28, pump29, pump30,
pump31, pump32, pump33, pump34, pump35,
pump36, pump37, pump38, pump39, pump40,
pump41, pump42, pump43, pump44, pump45,
pump46, pump47, pump48, pump49, pump50]
/ inputdevice = mouse
/ validresponse = (pump1, pump2, pump3, pump4, pump5,
pump6, pump7, pump8, pump9, pump10,
pump11, pump12, pump13, pump14, pump15,
pump16, pump17, pump18, pump19, pump20,
pump21, pump22, pump23, pump24, pump25,
pump26, pump27, pump28, pump29, pump30,
pump31, pump32, pump33, pump34, pump35,
pump36, pump37, pump38, pump39, pump40,
pump41, pump42, pump43, pump44, pump45,
pump46, pump47, pump48, pump49, pump50)
/ ontrialend = [
    values.wantedpumps = +trim(trial.pumpinput.response, "pump");
    //values.wantedpumps = trial.pumpinput.response;
    if (monkey.monkeyMode == true)
        values.wantedpumps = list.monkeyresponses.nextValue;
    if (parameters.fixed_explosionsequence == true)
        values.explosionpoint = list.fixed_explosionpoints.nextValue;
    values.timebefore1stpump = trial.pumpinput.latency;
    values.total_wantedpumps += values.wantedpumps;
    if (values.ballooncount < 11)
        values.total_wantedpumps_10 += values.wantedpumps
    else if (values.ballooncount <21 )
        values.total_wantedpumps_20 += values.wantedpumps
    else if (values.ballooncount <31 )
        values.total_wantedpumps_30 += values.wantedpumps
    ;
]    
/ branch = [
    if (values.wantedpumps > 0)
        return trial.pump;
    else
        return trial.collect;
]
/ recorddata = false
</trial>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search