Allow more than one response per trial


Author
Message
Diane
Diane
Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)
Group: Forum Members
Posts: 50, Visits: 125
Hi,
I present a trial on which a picture ("Alien" randomly drawn from an /item element) is shown together with 48 text elements. Participants should click 6 different elements. When they click a text element it changes color. I am using /branch to restart the trial (until 6 elements have been clicked), but on every restart a different picture is shown. How can I set it so that the picture stays the same until 6 responses are given?

Below is the code for the trial.

Thanks,
Diane

<trial TestTrial>
/ stimulusframes = [1=Alien, Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm]
/ validresponse = (Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm)
/ inputdevice = mouse
/ ontrialend = [
  if(trial.TestTrial.response=="Adaptable" && values.adaptablecolor==200){values.adaptablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adaptable"){values.adaptablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Adventurous" && values.adventurouscolor==200){values.adventurouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adventurous"){values.adventurouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Affectionate" && values.Affectionatecolor==200){values.Affectionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Affectionate"){values.Affectionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Aggressive" && values.Aggressivecolor==200){values.Aggressivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Aggressive"){values.Aggressivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Ambitious" && values.Ambitiouscolor==200){values.Ambitiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Ambitious"){values.Ambitiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Anxious" && values.Anxiouscolor==200){values.Anxiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Anxious"){values.Anxiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Arrogant" && values.Arrogantcolor==200){values.Arrogantcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Arrogant"){values.Arrogantcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bitter" && values.Bittercolor==200){values.Bittercolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bitter"){values.Bittercolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Boring" && values.Boringcolor==200){values.Boringcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Boring"){values.Boringcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Brave" && values.Bravecolor==200){values.Bravecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Brave"){values.Bravecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bullying" && values.Bullyingcolor==200){values.Bullyingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bullying"){values.Bullyingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Cheerful" && values.Cheerfulcolor==200){values.Cheerfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Cheerful"){values.Cheerfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Confident" && values.Confidentcolor==200){values.Confidentcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Confident"){values.Confidentcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Curious" && values.Curiouscolor==200){values.Curiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Curious"){values.Curiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Easygoing" && values.Easygoingcolor==200){values.Easygoingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Easygoing"){values.Easygoingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Excitable" && values.Excitablecolor==200){values.Excitablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Excitable"){values.Excitablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Flirty" && values.Flirtycolor==200){values.Flirtycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Flirty"){values.Flirtycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Friendly" && values.Friendlycolor==200){values.Friendlycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Friendly"){values.Friendlycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Funny" && values.Funnycolor==200){values.Funnycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Funny"){values.Funnycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Hostile" && values.Hostilecolor==200){values.Hostilecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Hostile"){values.Hostilecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Imaginative" && values.Imaginativecolor==200){values.Imaginativecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Imaginative"){values.Imaginativecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Jealous" && values.Jealouscolor==200){values.Jealouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Jealous"){values.Jealouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Lonely" && values.Lonelycolor==200){values.Lonelycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Lonely"){values.Lonelycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nasty" && values.Nastycolor==200){values.Nastycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nasty"){values.Nastycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nervous" && values.Nervouscolor==200){values.Nervouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nervous"){values.Nervouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Offensive" && values.Offensivecolor==200){values.Offensivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Offensive"){values.Offensivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Organised" && values.Organisedcolor==200){values.Organisedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Organised"){values.Organisedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passionate" && values.Passionatecolor==200){values.Passionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passionate"){values.Passionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passive" && values.Passivecolor==200){values.Passivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passive"){values.Passivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Patient" && values.Patientcolor==200){values.Patientcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Patient"){values.Patientcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Playful" && values.Playfulcolor==200){values.Playfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Playful"){values.Playfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Private" && values.Privatecolor==200){values.Privatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Private"){values.Privatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Proud" && values.Proudcolor==200){values.Proudcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Proud"){values.Proudcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reliable" && values.Reliablecolor==200){values.Reliablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reliable"){values.Reliablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reserved" && values.Reservedcolor==200){values.Reservedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reserved"){values.Reservedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Rude" && values.Rudecolor==200){values.Rudecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Rude"){values.Rudecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensible" && values.Sensiblecolor==200){values.Sensiblecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensible"){values.Sensiblecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensitive" && values.Sensitivecolor==200){values.Sensitivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensitive"){values.Sensitivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Serious" && values.Seriouscolor==200){values.Seriouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Serious"){values.Seriouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Shy" && values.Shycolor==200){values.Shycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Shy"){values.Shycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Successful" && values.Successfulcolor==200){values.Successfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Successful"){values.Successfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tactful" && values.Tactfulcolor==200){values.Tactfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tactful"){values.Tactfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Talented" && values.Talentedcolor==200){values.Talentedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Talented"){values.Talentedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Thoughtless" && values.Thoughtlesscolor==200){values.Thoughtlesscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Thoughtless"){values.Thoughtlesscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tidy" && values.Tidycolor==200){values.Tidycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tidy"){values.Tidycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Troublesome" && values.Troublesomecolor==200){values.Troublesomecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Troublesome"){values.Troublesomecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Vulgar" && values.Vulgarcolor==200){values.Vulgarcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Vulgar"){values.Vulgarcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Warm" && values.Warmcolor==200){values.Warmcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Warm"){values.Warmcolor=200;values.Nchoices-=1;values.Validchoice=0}
      ]
/branch = [if(values.Nchoices==6)trial.NextTrial]
/branch = [trial.TestTrial]
</trial>

<picture Alien>
/ items = Aliens
/ position = (50,25)
/ select = noreplace
</picture>

<item Aliens>
/1 = "BC small.png"
/2 = "BS small.png"
/3 = "BT small.png"
/4 = "GC small.png"
/5 = "GS small.png"
/6 = "GT small.png"
/7 = "RC small.png"
/8 = "RS small.png"
/9 = "RT small.png"
</item>

Dave
Dave
Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)
Group: Administrators
Posts: 11K, Visits: 77K
Diane - 12/6/2021
Hi,
I present a trial on which a picture ("Alien" randomly drawn from an /item element) is shown together with 48 text elements. Participants should click 6 different elements. When they click a text element it changes color. I am using /branch to restart the trial (until 6 elements have been clicked), but on every restart a different picture is shown. How can I set it so that the picture stays the same until 6 responses are given?

Below is the code for the trial.

Thanks,
Diane

<trial TestTrial>
/ stimulusframes = [1=Alien, Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm]
/ validresponse = (Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm)
/ inputdevice = mouse
/ ontrialend = [
  if(trial.TestTrial.response=="Adaptable" && values.adaptablecolor==200){values.adaptablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adaptable"){values.adaptablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Adventurous" && values.adventurouscolor==200){values.adventurouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adventurous"){values.adventurouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Affectionate" && values.Affectionatecolor==200){values.Affectionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Affectionate"){values.Affectionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Aggressive" && values.Aggressivecolor==200){values.Aggressivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Aggressive"){values.Aggressivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Ambitious" && values.Ambitiouscolor==200){values.Ambitiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Ambitious"){values.Ambitiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Anxious" && values.Anxiouscolor==200){values.Anxiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Anxious"){values.Anxiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Arrogant" && values.Arrogantcolor==200){values.Arrogantcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Arrogant"){values.Arrogantcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bitter" && values.Bittercolor==200){values.Bittercolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bitter"){values.Bittercolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Boring" && values.Boringcolor==200){values.Boringcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Boring"){values.Boringcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Brave" && values.Bravecolor==200){values.Bravecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Brave"){values.Bravecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bullying" && values.Bullyingcolor==200){values.Bullyingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bullying"){values.Bullyingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Cheerful" && values.Cheerfulcolor==200){values.Cheerfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Cheerful"){values.Cheerfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Confident" && values.Confidentcolor==200){values.Confidentcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Confident"){values.Confidentcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Curious" && values.Curiouscolor==200){values.Curiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Curious"){values.Curiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Easygoing" && values.Easygoingcolor==200){values.Easygoingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Easygoing"){values.Easygoingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Excitable" && values.Excitablecolor==200){values.Excitablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Excitable"){values.Excitablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Flirty" && values.Flirtycolor==200){values.Flirtycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Flirty"){values.Flirtycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Friendly" && values.Friendlycolor==200){values.Friendlycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Friendly"){values.Friendlycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Funny" && values.Funnycolor==200){values.Funnycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Funny"){values.Funnycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Hostile" && values.Hostilecolor==200){values.Hostilecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Hostile"){values.Hostilecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Imaginative" && values.Imaginativecolor==200){values.Imaginativecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Imaginative"){values.Imaginativecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Jealous" && values.Jealouscolor==200){values.Jealouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Jealous"){values.Jealouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Lonely" && values.Lonelycolor==200){values.Lonelycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Lonely"){values.Lonelycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nasty" && values.Nastycolor==200){values.Nastycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nasty"){values.Nastycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nervous" && values.Nervouscolor==200){values.Nervouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nervous"){values.Nervouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Offensive" && values.Offensivecolor==200){values.Offensivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Offensive"){values.Offensivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Organised" && values.Organisedcolor==200){values.Organisedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Organised"){values.Organisedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passionate" && values.Passionatecolor==200){values.Passionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passionate"){values.Passionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passive" && values.Passivecolor==200){values.Passivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passive"){values.Passivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Patient" && values.Patientcolor==200){values.Patientcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Patient"){values.Patientcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Playful" && values.Playfulcolor==200){values.Playfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Playful"){values.Playfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Private" && values.Privatecolor==200){values.Privatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Private"){values.Privatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Proud" && values.Proudcolor==200){values.Proudcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Proud"){values.Proudcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reliable" && values.Reliablecolor==200){values.Reliablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reliable"){values.Reliablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reserved" && values.Reservedcolor==200){values.Reservedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reserved"){values.Reservedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Rude" && values.Rudecolor==200){values.Rudecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Rude"){values.Rudecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensible" && values.Sensiblecolor==200){values.Sensiblecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensible"){values.Sensiblecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensitive" && values.Sensitivecolor==200){values.Sensitivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensitive"){values.Sensitivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Serious" && values.Seriouscolor==200){values.Seriouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Serious"){values.Seriouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Shy" && values.Shycolor==200){values.Shycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Shy"){values.Shycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Successful" && values.Successfulcolor==200){values.Successfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Successful"){values.Successfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tactful" && values.Tactfulcolor==200){values.Tactfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tactful"){values.Tactfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Talented" && values.Talentedcolor==200){values.Talentedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Talented"){values.Talentedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Thoughtless" && values.Thoughtlesscolor==200){values.Thoughtlesscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Thoughtless"){values.Thoughtlesscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tidy" && values.Tidycolor==200){values.Tidycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tidy"){values.Tidycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Troublesome" && values.Troublesomecolor==200){values.Troublesomecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Troublesome"){values.Troublesomecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Vulgar" && values.Vulgarcolor==200){values.Vulgarcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Vulgar"){values.Vulgarcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Warm" && values.Warmcolor==200){values.Warmcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Warm"){values.Warmcolor=200;values.Nchoices-=1;values.Validchoice=0}
      ]
/branch = [if(values.Nchoices==6)trial.NextTrial]
/branch = [trial.TestTrial]
</trial>

<picture Alien>
/ items = Aliens
/ position = (50,25)
/ select = noreplace
</picture>

<item Aliens>
/1 = "BC small.png"
/2 = "BS small.png"
/3 = "BT small.png"
/4 = "GC small.png"
/5 = "GS small.png"
/6 = "GT small.png"
/7 = "RC small.png"
/8 = "RS small.png"
/9 = "RT small.png"
</item>

Use <values> and a list to select item numbers for the "Aliens" picture element, only sample a new item number from the list when a new round starts.

Diane
Diane
Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)
Group: Forum Members
Posts: 50, Visits: 125
Dave - 12/6/2021
Diane - 12/6/2021
Hi,
I present a trial on which a picture ("Alien" randomly drawn from an /item element) is shown together with 48 text elements. Participants should click 6 different elements. When they click a text element it changes color. I am using /branch to restart the trial (until 6 elements have been clicked), but on every restart a different picture is shown. How can I set it so that the picture stays the same until 6 responses are given?

Below is the code for the trial.

Thanks,
Diane

<trial TestTrial>
/ stimulusframes = [1=Alien, Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm]
/ validresponse = (Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm)
/ inputdevice = mouse
/ ontrialend = [
  if(trial.TestTrial.response=="Adaptable" && values.adaptablecolor==200){values.adaptablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adaptable"){values.adaptablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Adventurous" && values.adventurouscolor==200){values.adventurouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adventurous"){values.adventurouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Affectionate" && values.Affectionatecolor==200){values.Affectionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Affectionate"){values.Affectionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Aggressive" && values.Aggressivecolor==200){values.Aggressivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Aggressive"){values.Aggressivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Ambitious" && values.Ambitiouscolor==200){values.Ambitiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Ambitious"){values.Ambitiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Anxious" && values.Anxiouscolor==200){values.Anxiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Anxious"){values.Anxiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Arrogant" && values.Arrogantcolor==200){values.Arrogantcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Arrogant"){values.Arrogantcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bitter" && values.Bittercolor==200){values.Bittercolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bitter"){values.Bittercolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Boring" && values.Boringcolor==200){values.Boringcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Boring"){values.Boringcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Brave" && values.Bravecolor==200){values.Bravecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Brave"){values.Bravecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bullying" && values.Bullyingcolor==200){values.Bullyingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bullying"){values.Bullyingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Cheerful" && values.Cheerfulcolor==200){values.Cheerfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Cheerful"){values.Cheerfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Confident" && values.Confidentcolor==200){values.Confidentcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Confident"){values.Confidentcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Curious" && values.Curiouscolor==200){values.Curiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Curious"){values.Curiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Easygoing" && values.Easygoingcolor==200){values.Easygoingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Easygoing"){values.Easygoingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Excitable" && values.Excitablecolor==200){values.Excitablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Excitable"){values.Excitablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Flirty" && values.Flirtycolor==200){values.Flirtycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Flirty"){values.Flirtycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Friendly" && values.Friendlycolor==200){values.Friendlycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Friendly"){values.Friendlycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Funny" && values.Funnycolor==200){values.Funnycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Funny"){values.Funnycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Hostile" && values.Hostilecolor==200){values.Hostilecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Hostile"){values.Hostilecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Imaginative" && values.Imaginativecolor==200){values.Imaginativecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Imaginative"){values.Imaginativecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Jealous" && values.Jealouscolor==200){values.Jealouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Jealous"){values.Jealouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Lonely" && values.Lonelycolor==200){values.Lonelycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Lonely"){values.Lonelycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nasty" && values.Nastycolor==200){values.Nastycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nasty"){values.Nastycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nervous" && values.Nervouscolor==200){values.Nervouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nervous"){values.Nervouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Offensive" && values.Offensivecolor==200){values.Offensivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Offensive"){values.Offensivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Organised" && values.Organisedcolor==200){values.Organisedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Organised"){values.Organisedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passionate" && values.Passionatecolor==200){values.Passionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passionate"){values.Passionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passive" && values.Passivecolor==200){values.Passivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passive"){values.Passivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Patient" && values.Patientcolor==200){values.Patientcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Patient"){values.Patientcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Playful" && values.Playfulcolor==200){values.Playfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Playful"){values.Playfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Private" && values.Privatecolor==200){values.Privatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Private"){values.Privatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Proud" && values.Proudcolor==200){values.Proudcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Proud"){values.Proudcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reliable" && values.Reliablecolor==200){values.Reliablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reliable"){values.Reliablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reserved" && values.Reservedcolor==200){values.Reservedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reserved"){values.Reservedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Rude" && values.Rudecolor==200){values.Rudecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Rude"){values.Rudecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensible" && values.Sensiblecolor==200){values.Sensiblecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensible"){values.Sensiblecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensitive" && values.Sensitivecolor==200){values.Sensitivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensitive"){values.Sensitivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Serious" && values.Seriouscolor==200){values.Seriouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Serious"){values.Seriouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Shy" && values.Shycolor==200){values.Shycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Shy"){values.Shycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Successful" && values.Successfulcolor==200){values.Successfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Successful"){values.Successfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tactful" && values.Tactfulcolor==200){values.Tactfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tactful"){values.Tactfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Talented" && values.Talentedcolor==200){values.Talentedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Talented"){values.Talentedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Thoughtless" && values.Thoughtlesscolor==200){values.Thoughtlesscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Thoughtless"){values.Thoughtlesscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tidy" && values.Tidycolor==200){values.Tidycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tidy"){values.Tidycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Troublesome" && values.Troublesomecolor==200){values.Troublesomecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Troublesome"){values.Troublesomecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Vulgar" && values.Vulgarcolor==200){values.Vulgarcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Vulgar"){values.Vulgarcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Warm" && values.Warmcolor==200){values.Warmcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Warm"){values.Warmcolor=200;values.Nchoices-=1;values.Validchoice=0}
      ]
/branch = [if(values.Nchoices==6)trial.NextTrial]
/branch = [trial.TestTrial]
</trial>

<picture Alien>
/ items = Aliens
/ position = (50,25)
/ select = noreplace
</picture>

<item Aliens>
/1 = "BC small.png"
/2 = "BS small.png"
/3 = "BT small.png"
/4 = "GC small.png"
/5 = "GS small.png"
/6 = "GT small.png"
/7 = "RC small.png"
/8 = "RS small.png"
/9 = "RT small.png"
</item>

Use <values> and a list to select item numbers for the "Aliens" picture element, only sample a new item number from the list when a new round starts.

Hi Dave,
Thanks so much, this works.
I have a follow-up question: At the end of the trial (i.e., after a response) I branch to the same trial again if there are fewer than 6 responses. After each response this causes a short flicker in the presentation. Is there a way to leave the items on screen so that there is no flicker?
Thanks,
Diane

Dave
Dave
Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)Supreme Being (985K reputation)
Group: Administrators
Posts: 11K, Visits: 77K
Diane - 12/12/2021
Dave - 12/6/2021
Diane - 12/6/2021
Hi,
I present a trial on which a picture ("Alien" randomly drawn from an /item element) is shown together with 48 text elements. Participants should click 6 different elements. When they click a text element it changes color. I am using /branch to restart the trial (until 6 elements have been clicked), but on every restart a different picture is shown. How can I set it so that the picture stays the same until 6 responses are given?

Below is the code for the trial.

Thanks,
Diane

<trial TestTrial>
/ stimulusframes = [1=Alien, Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm]
/ validresponse = (Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm)
/ inputdevice = mouse
/ ontrialend = [
  if(trial.TestTrial.response=="Adaptable" && values.adaptablecolor==200){values.adaptablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adaptable"){values.adaptablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Adventurous" && values.adventurouscolor==200){values.adventurouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adventurous"){values.adventurouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Affectionate" && values.Affectionatecolor==200){values.Affectionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Affectionate"){values.Affectionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Aggressive" && values.Aggressivecolor==200){values.Aggressivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Aggressive"){values.Aggressivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Ambitious" && values.Ambitiouscolor==200){values.Ambitiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Ambitious"){values.Ambitiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Anxious" && values.Anxiouscolor==200){values.Anxiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Anxious"){values.Anxiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Arrogant" && values.Arrogantcolor==200){values.Arrogantcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Arrogant"){values.Arrogantcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bitter" && values.Bittercolor==200){values.Bittercolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bitter"){values.Bittercolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Boring" && values.Boringcolor==200){values.Boringcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Boring"){values.Boringcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Brave" && values.Bravecolor==200){values.Bravecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Brave"){values.Bravecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bullying" && values.Bullyingcolor==200){values.Bullyingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bullying"){values.Bullyingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Cheerful" && values.Cheerfulcolor==200){values.Cheerfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Cheerful"){values.Cheerfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Confident" && values.Confidentcolor==200){values.Confidentcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Confident"){values.Confidentcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Curious" && values.Curiouscolor==200){values.Curiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Curious"){values.Curiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Easygoing" && values.Easygoingcolor==200){values.Easygoingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Easygoing"){values.Easygoingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Excitable" && values.Excitablecolor==200){values.Excitablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Excitable"){values.Excitablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Flirty" && values.Flirtycolor==200){values.Flirtycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Flirty"){values.Flirtycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Friendly" && values.Friendlycolor==200){values.Friendlycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Friendly"){values.Friendlycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Funny" && values.Funnycolor==200){values.Funnycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Funny"){values.Funnycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Hostile" && values.Hostilecolor==200){values.Hostilecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Hostile"){values.Hostilecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Imaginative" && values.Imaginativecolor==200){values.Imaginativecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Imaginative"){values.Imaginativecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Jealous" && values.Jealouscolor==200){values.Jealouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Jealous"){values.Jealouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Lonely" && values.Lonelycolor==200){values.Lonelycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Lonely"){values.Lonelycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nasty" && values.Nastycolor==200){values.Nastycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nasty"){values.Nastycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nervous" && values.Nervouscolor==200){values.Nervouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nervous"){values.Nervouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Offensive" && values.Offensivecolor==200){values.Offensivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Offensive"){values.Offensivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Organised" && values.Organisedcolor==200){values.Organisedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Organised"){values.Organisedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passionate" && values.Passionatecolor==200){values.Passionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passionate"){values.Passionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passive" && values.Passivecolor==200){values.Passivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passive"){values.Passivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Patient" && values.Patientcolor==200){values.Patientcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Patient"){values.Patientcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Playful" && values.Playfulcolor==200){values.Playfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Playful"){values.Playfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Private" && values.Privatecolor==200){values.Privatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Private"){values.Privatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Proud" && values.Proudcolor==200){values.Proudcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Proud"){values.Proudcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reliable" && values.Reliablecolor==200){values.Reliablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reliable"){values.Reliablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reserved" && values.Reservedcolor==200){values.Reservedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reserved"){values.Reservedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Rude" && values.Rudecolor==200){values.Rudecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Rude"){values.Rudecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensible" && values.Sensiblecolor==200){values.Sensiblecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensible"){values.Sensiblecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensitive" && values.Sensitivecolor==200){values.Sensitivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensitive"){values.Sensitivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Serious" && values.Seriouscolor==200){values.Seriouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Serious"){values.Seriouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Shy" && values.Shycolor==200){values.Shycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Shy"){values.Shycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Successful" && values.Successfulcolor==200){values.Successfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Successful"){values.Successfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tactful" && values.Tactfulcolor==200){values.Tactfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tactful"){values.Tactfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Talented" && values.Talentedcolor==200){values.Talentedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Talented"){values.Talentedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Thoughtless" && values.Thoughtlesscolor==200){values.Thoughtlesscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Thoughtless"){values.Thoughtlesscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tidy" && values.Tidycolor==200){values.Tidycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tidy"){values.Tidycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Troublesome" && values.Troublesomecolor==200){values.Troublesomecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Troublesome"){values.Troublesomecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Vulgar" && values.Vulgarcolor==200){values.Vulgarcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Vulgar"){values.Vulgarcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Warm" && values.Warmcolor==200){values.Warmcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Warm"){values.Warmcolor=200;values.Nchoices-=1;values.Validchoice=0}
      ]
/branch = [if(values.Nchoices==6)trial.NextTrial]
/branch = [trial.TestTrial]
</trial>

<picture Alien>
/ items = Aliens
/ position = (50,25)
/ select = noreplace
</picture>

<item Aliens>
/1 = "BC small.png"
/2 = "BS small.png"
/3 = "BT small.png"
/4 = "GC small.png"
/5 = "GS small.png"
/6 = "GT small.png"
/7 = "RC small.png"
/8 = "RS small.png"
/9 = "RT small.png"
</item>

Use <values> and a list to select item numbers for the "Aliens" picture element, only sample a new item number from the list when a new round starts.

Hi Dave,
Thanks so much, this works.
I have a follow-up question: At the end of the trial (i.e., after a response) I branch to the same trial again if there are fewer than 6 responses. After each response this causes a short flicker in the presentation. Is there a way to leave the items on screen so that there is no flicker?
Thanks,
Diane

> Is there a way to leave the items on screen so that there is no flicker?

Yes. Set the respective stimulus elements' /erase attributes to false.

Diane
Diane
Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)Distinguished Member (3.5K reputation)
Group: Forum Members
Posts: 50, Visits: 125
Dave - 12/13/2021
Diane - 12/12/2021
Dave - 12/6/2021
Diane - 12/6/2021
Hi,
I present a trial on which a picture ("Alien" randomly drawn from an /item element) is shown together with 48 text elements. Participants should click 6 different elements. When they click a text element it changes color. I am using /branch to restart the trial (until 6 elements have been clicked), but on every restart a different picture is shown. How can I set it so that the picture stays the same until 6 responses are given?

Below is the code for the trial.

Thanks,
Diane

<trial TestTrial>
/ stimulusframes = [1=Alien, Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm]
/ validresponse = (Adaptable, Adventurous, Affectionate, Aggressive, Ambitious, Anxious, Arrogant, Bitter,
                     Boring, Brave, Bullying, Cheerful, Confident, Curious, Easygoing, Excitable,
                     Flirty, Friendly, Funny, Hostile, Imaginative, Jealous, Lonely, Nasty,
                     Nervous, Offensive, Organised, Passionate, Passive, Patient, Playful, Private,
                     Proud, Reliable, Reserved, Rude, Sensible, Sensitive, Serious, Shy,
                     Successful, Tactful, Talented, Thoughtless, Tidy, Troublesome, Vulgar, Warm)
/ inputdevice = mouse
/ ontrialend = [
  if(trial.TestTrial.response=="Adaptable" && values.adaptablecolor==200){values.adaptablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adaptable"){values.adaptablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Adventurous" && values.adventurouscolor==200){values.adventurouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Adventurous"){values.adventurouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Affectionate" && values.Affectionatecolor==200){values.Affectionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Affectionate"){values.Affectionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Aggressive" && values.Aggressivecolor==200){values.Aggressivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Aggressive"){values.Aggressivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Ambitious" && values.Ambitiouscolor==200){values.Ambitiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Ambitious"){values.Ambitiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Anxious" && values.Anxiouscolor==200){values.Anxiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Anxious"){values.Anxiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Arrogant" && values.Arrogantcolor==200){values.Arrogantcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Arrogant"){values.Arrogantcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bitter" && values.Bittercolor==200){values.Bittercolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bitter"){values.Bittercolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Boring" && values.Boringcolor==200){values.Boringcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Boring"){values.Boringcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Brave" && values.Bravecolor==200){values.Bravecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Brave"){values.Bravecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Bullying" && values.Bullyingcolor==200){values.Bullyingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Bullying"){values.Bullyingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Cheerful" && values.Cheerfulcolor==200){values.Cheerfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Cheerful"){values.Cheerfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Confident" && values.Confidentcolor==200){values.Confidentcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Confident"){values.Confidentcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Curious" && values.Curiouscolor==200){values.Curiouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Curious"){values.Curiouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Easygoing" && values.Easygoingcolor==200){values.Easygoingcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Easygoing"){values.Easygoingcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Excitable" && values.Excitablecolor==200){values.Excitablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Excitable"){values.Excitablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Flirty" && values.Flirtycolor==200){values.Flirtycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Flirty"){values.Flirtycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Friendly" && values.Friendlycolor==200){values.Friendlycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Friendly"){values.Friendlycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Funny" && values.Funnycolor==200){values.Funnycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Funny"){values.Funnycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Hostile" && values.Hostilecolor==200){values.Hostilecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Hostile"){values.Hostilecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Imaginative" && values.Imaginativecolor==200){values.Imaginativecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Imaginative"){values.Imaginativecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Jealous" && values.Jealouscolor==200){values.Jealouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Jealous"){values.Jealouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Lonely" && values.Lonelycolor==200){values.Lonelycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Lonely"){values.Lonelycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nasty" && values.Nastycolor==200){values.Nastycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nasty"){values.Nastycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Nervous" && values.Nervouscolor==200){values.Nervouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Nervous"){values.Nervouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Offensive" && values.Offensivecolor==200){values.Offensivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Offensive"){values.Offensivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Organised" && values.Organisedcolor==200){values.Organisedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Organised"){values.Organisedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passionate" && values.Passionatecolor==200){values.Passionatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passionate"){values.Passionatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Passive" && values.Passivecolor==200){values.Passivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Passive"){values.Passivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Patient" && values.Patientcolor==200){values.Patientcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Patient"){values.Patientcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Playful" && values.Playfulcolor==200){values.Playfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Playful"){values.Playfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Private" && values.Privatecolor==200){values.Privatecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Private"){values.Privatecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Proud" && values.Proudcolor==200){values.Proudcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Proud"){values.Proudcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reliable" && values.Reliablecolor==200){values.Reliablecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reliable"){values.Reliablecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Reserved" && values.Reservedcolor==200){values.Reservedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Reserved"){values.Reservedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Rude" && values.Rudecolor==200){values.Rudecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Rude"){values.Rudecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensible" && values.Sensiblecolor==200){values.Sensiblecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensible"){values.Sensiblecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Sensitive" && values.Sensitivecolor==200){values.Sensitivecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Sensitive"){values.Sensitivecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Serious" && values.Seriouscolor==200){values.Seriouscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Serious"){values.Seriouscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Shy" && values.Shycolor==200){values.Shycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Shy"){values.Shycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Successful" && values.Successfulcolor==200){values.Successfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Successful"){values.Successfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tactful" && values.Tactfulcolor==200){values.Tactfulcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tactful"){values.Tactfulcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Talented" && values.Talentedcolor==200){values.Talentedcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Talented"){values.Talentedcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Thoughtless" && values.Thoughtlesscolor==200){values.Thoughtlesscolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Thoughtless"){values.Thoughtlesscolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Tidy" && values.Tidycolor==200){values.Tidycolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Tidy"){values.Tidycolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Troublesome" && values.Troublesomecolor==200){values.Troublesomecolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Troublesome"){values.Troublesomecolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Vulgar" && values.Vulgarcolor==200){values.Vulgarcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Vulgar"){values.Vulgarcolor=200;values.Nchoices-=1;values.Validchoice=0};
  if(trial.TestTrial.response=="Warm" && values.Warmcolor==200){values.Warmcolor=150;values.Nchoices+=1;values.Validchoice=1}
   else if(trial.TestTrial.response=="Warm"){values.Warmcolor=200;values.Nchoices-=1;values.Validchoice=0}
      ]
/branch = [if(values.Nchoices==6)trial.NextTrial]
/branch = [trial.TestTrial]
</trial>

<picture Alien>
/ items = Aliens
/ position = (50,25)
/ select = noreplace
</picture>

<item Aliens>
/1 = "BC small.png"
/2 = "BS small.png"
/3 = "BT small.png"
/4 = "GC small.png"
/5 = "GS small.png"
/6 = "GT small.png"
/7 = "RC small.png"
/8 = "RS small.png"
/9 = "RT small.png"
</item>

Use <values> and a list to select item numbers for the "Aliens" picture element, only sample a new item number from the list when a new round starts.

Hi Dave,
Thanks so much, this works.
I have a follow-up question: At the end of the trial (i.e., after a response) I branch to the same trial again if there are fewer than 6 responses. After each response this causes a short flicker in the presentation. Is there a way to leave the items on screen so that there is no flicker?
Thanks,
Diane

> Is there a way to leave the items on screen so that there is no flicker?

Yes. Set the respective stimulus elements' /erase attributes to false.

Thanks a lot!
Diane

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search