integrating list to avoid duplicates


Author
Message
ai293
ai293
New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)New Member (32 reputation)
Group: Forum Members
Posts: 7, Visits: 68
Hi! I'm trying to build a modified go/no-go task that's based on participant inputs.

What I've done so far: Participants first respond to a survey asking them to list 10 names. After, the names are presented in a go/no-go task. In addition to the names that participants provide, I want to add 10 random names to the go/no-go as "neutral" stimuli (out of a bank of 20 names)

What I'm attempting to do but haven't figure out how to do yet:  I want to add a rule to my code where the random names that are thrown into the go/no-go are not the same as the names the participant has nominated (e.g., if the participant nominated the name "Claire," I want to avoid using the name "Claire" as my neutral stimulus). At the same time, if I use "Claire" as my neutral stimulus 1, I want "Claire" to repeat in each "chunk" in my block (for reference, see my block code below and how it's grouped into  4-23, 24-43, etc).

I have an intuition that I could use <list> for this, but I can't figure out whether using list is correct and how to integrate it into my code. Do I add the "list" at the end of each trial? Do I create a trial for each name in go/no-go task, even the neutral stimuli? I have added the code below for "name 1" just to make this clearer, but I could add my complete  code for all names if needed. Thanks!

<values>
/ quit = 0
/ complete = 0
/ name_1= ""
/ name_2 = ""
/ name_3 = ""
/ name_4 = ""
/ name_5= ""
/ name_6 = ""
/ name_7 = ""
/ name_8 = ""
/ name_9= ""
/ name_10 = ""
/ name_11= "NEUTRAL_NAME1"
/ name_12= "NEUTRAL_NAME2"
/ name_13 = "NEUTRAL_NAME3"
/ name_14 = "NEUTRAL_NAME4"
/ name_15= "NEUTRAL_NAME5"
/ name_16 = "NEUTRAL_NAME6"
/ name_17 = "NEUTRAL_NAME7"
/ name_18 = "NEUTRAL_NAME8"
/ name_19= "NEUTRAL_NAME9"
/ name_20 = "NEUTRAL_NAME10"
/ name_21= "NEUTRAL_NAME11"
/ name_22= "NEUTRAL_NAME12"
/ name_23 = "NEUTRAL_NAME13"
/ name_24 = "NEUTRAL_NAME14"
/ name_25= "NEUTRAL_NAME15"
/ name_26 = "NEUTRAL_NAME16"
/ name_27 = "NEUTRAL_NAME17"
/ name_28 = "NEUTRAL_NAME18"
/ name_29= "NEUTRAL_NAME19"
/ name_30 = "NEUTRAL_NAME20"
</values>

<text name_1>
/ numitems = 1
/ items = name_1
/ select = noreplace
/ fontstyle = ("Arial", parameters.wordSize, true, false, false, false, 5, 1)
/ size = (80%, parameters.wordSize*2)
/ erase = false
/ vjustify = center
</text>

<item name_1>
</item>

<trial trial_name_1>
/ ontrialbegin = [
    trial.trial_name_1.insertStimulusTime(clearScreen, parameters.stimDuration);    
]
/ stimulustimes = [0 = name_1]
/ validresponse = (parameters.goKey, 0)
/ correctresponse = (parameters.goKey, 0)
/ beginresponsetime = 0
/ responseinterrupt = frames
/ timeout = parameters.responseDuration
/ ontrialend = [
    trial.trial_name_1.resetStimulusFrames();
    values.respRT = trial.trial_name_1.latency;
    values.word = text.name_1.currentItem]
</trial>

<block names_gono>
/ skip = [
    parameters.runPractice == false;
]
/ onblockbegin = [
    values.GoStim = item.friends_catLABEL.item(1); //selects the appropriate label for the practice GO category
    values.NoGoStim = item.nonfriendsNoGo_catLABEL.item(1); //selects the appropriate label for the practice NOGO category
    values.condition = "practice";
]
/ trials = [
    1 = blockInstructions;
    2 = getReady;
    3 = start;
    4-23 = noreplacenorepeat(trial_name_1, trial_name_2, trial_name_3, trial_name_4, trial_name_5, trial_name_6, trial_name_7, trial_name_8, trial_name_9, trial_name_10, trial_name_11, trial_name_12, trial_name_13, trial_name_14, trial_name_15, trial_name_16, trial_name_17, trial_name_18, trial_name_19, trial_name_20);
    24-43 = noreplacenorepeat(trial_name_1, trial_name_2, trial_name_3, trial_name_4, trial_name_5, trial_name_6, trial_name_7, trial_name_8, trial_name_9, trial_name_10, trial_name_11, trial_name_12, trial_name_13, trial_name_14, trial_name_15, trial_name_16, trial_name_17, trial_name_18, trial_name_19, trial_name_20);
    44-63 = noreplacenorepeat(trial_name_1, trial_name_2, trial_name_3, trial_name_4, trial_name_5, trial_name_6, trial_name_7, trial_name_8, trial_name_9, trial_name_10, trial_name_11, trial_name_12, trial_name_13, trial_name_14, trial_name_15, trial_name_16, trial_name_17, trial_name_18, trial_name_19, trial_name_20);
    64-83 = noreplacenorepeat(trial_name_1, trial_name_2, trial_name_3, trial_name_4, trial_name_5, trial_name_6, trial_name_7, trial_name_8, trial_name_9, trial_name_10, trial_name_11, trial_name_12, trial_name_13, trial_name_14, trial_name_15, trial_name_16, trial_name_17, trial_name_18, trial_name_19, trial_name_20);
    84-103 = noreplacenorepeat(trial_name_1, trial_name_2, trial_name_3, trial_name_4, trial_name_5, trial_name_6, trial_name_7, trial_name_8, trial_name_9, trial_name_10, trial_name_11, trial_name_12, trial_name_13, trial_name_14, trial_name_15, trial_name_16, trial_name_17, trial_name_18, trial_name_19, trial_name_20);
        104 = end;
]
/ branch = [if (block.names_gono.totaltrialcount >= 1) block.closeness
]
</block>

<list list1>
/ items=[item.name_1; item.name_2; item.name_3; item.name_4; item.name_5; item.name_6; item.name_7; item.name_8; item.name_9; item.name_10]
</list>

<list list2>
/ items=[item.name_11; item.name_12; item.name_13; item.name_14; item.name_15; item.name_16; item.name_17; item.name_18; item.name_19;
item.name_20;item.name_21; item.name_22; item.name_23; item.name_24; item.name_25; item.name_26; item.name_27; item.name_28;
item.name_29;
item.name_30
]
/ selectionMode=random
/ not=[list.list1.currentValue]
</list>



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
ai293 - 3 days ago @ 9:53 PM
Dave - 2 days ago @ 4:58 AM
             One way to go about this:
Dave - 2 days ago @ 5:55 AM
ai293 - 2 days ago @ 9:23 AM
Dave - 2 days ago @ 9:30 AM
                         Hi Dave, Apologies, there are multiple tasks in this script, so I just...
ai293 - 2 days ago @ 9:37 AM
                             for reference, the survey where participants enter names is <survey...
ai293 - 2 days ago @ 9:39 AM
                             This makes no sense. The <item> elements referenced are empty...
Dave - 2 days ago @ 9:46 AM
                                 Thanks Dave. I just tried this, and it worked great. Wouldn't have...
ai293 - Yesterday @ 1:05 PM

Reading This Topic

Explore
Messages
Mentions
Search