Millisecond Forums

toupper

https://forums.millisecond.com/Topic27933.aspx

By jens - 11/2/2019

Hello,
I am programming a LDT for some students of my class. So far so good, however, the student did not provide the targets in upper case which is necessary for this experiment. Instead of having them to correct all targets, I tried to convert all targets to upper case in Inquisit in various ways but failed. So, tfake has to be presented in upper case. Hints (and solutions) are welcome.

Best wishes Jens

<trial t_fake>
/ontrialbegin = [values.trialcounter += 1;]
/ontrialend = [values.prime = text.trpfake.currentitem; values.target = text.tfake.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, trpfake; 64 = blank, tfake]
/validresponse = ("F", "J")
/correctresponse = ("F")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>

By Dave - 11/3/2019

jens - 11/2/2019
Hello,
I am programming a LDT for some students of my class. So far so good, however, the student did not provide the targets in upper case which is necessary for this experiment. Instead of having them to correct all targets, I tried to convert all targets to upper case in Inquisit in various ways but failed. So, tfake has to be presented in upper case. Hints (and solutions) are welcome.

Best wishes Jens

<trial t_fake>
/ontrialbegin = [values.trialcounter += 1;]
/ontrialend = [values.prime = text.trpfake.currentitem; values.target = text.tfake.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, trpfake; 64 = blank, tfake]
/validresponse = ("F", "J")
/correctresponse = ("F")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>


Inquisit has a toupper() string function, which you can use for that.

<item tfakeitems>
/ 1 = "abc"
/ 2 = "def"
/ 3 = "ghi"
/ 4 = "jkl"
</item>

<text tfake>
/ items = tfakeitems
</text>

<values>
/ index = 0
</values>


<trial t_fake>
/ ontrialbegin = [values.index = text.tfake.nextindex;
item.tfakeitems.setitem(toupper(item.tfakeitems.item(values.index)), values.index);
]
/ stimulusframes = [1=tfake]
/ validresponse = (57)
</trial>

<block example>
/ trials = [1-4 = t_fake]
</block>

By jens - 11/3/2019

Hello,

Thanks a lot for your solution. I tried toupper and .setitem but I failed on setting the proper index.

Best wishes Jens
By jens - 11/4/2019

jens - 11/4/2019
Hello,Thanks a lot for your solution. I tried toupper and .setitem but I failed on setting the proper index. Best wishes Jens

Hello,
I tried out your code and it worked perfectly, however, it does not work in this code. I miss the difference.

<text aufwaermtarget>
/items = aufwaermtargeti
/select = current(aufwaermprime)
</text>

<item aufwaermtargeti>
/161 = "Krimte"
/162 = "Heizung"
/163 = "Klimer"
/164 = "Wunde"
/165 = "Kohle"
/166 = "Farnseber"
/167 = "Tobel"
/168 = "Husten"
</item>

<text aufwaermprime>
/items = aufwaermprimes.items
/select = noreplace
</text>

<item aufwaermprimes.items>
/161 = "Kapuzenpullover"
/162 = "Gedankenkontrolle"
/163 = "Tapetenkleber"
/164 = "Schnittwunde"
/165 = "Abflussreiniger"
/166 = "Röhrenfernseher"
/167 = "Raucherhusten"
/168 = "Bürgerwehr"
</item>

<trial aufwaerm>
/ontrialbegin = [values.trialcounter += 1; values.index = text.aufwaermtarget.nextindex;
      item.aufwaermtargeti.setitem(toupper(item.aufwaermtargeti.item(values.index)), values.index);]
/ontrialend = [values.prime = text.aufwaermprime.currentitem; values.target = text.aufwaermtarget.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, aufwaermprime; 64 = blank, aufwaermtarget]
/validresponse = ("F", "J")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>
By Dave - 11/4/2019

jens - 11/4/2019
jens - 11/4/2019
Hello,Thanks a lot for your solution. I tried toupper and .setitem but I failed on setting the proper index. Best wishes Jens

Hello,
I tried out your code and it worked perfectly, however, it does not work in this code. I miss the difference.

<text aufwaermtarget>
/items = aufwaermtargeti
/select = current(aufwaermprime)
</text>

<item aufwaermtargeti>
/161 = "Krimte"
/162 = "Heizung"
/163 = "Klimer"
/164 = "Wunde"
/165 = "Kohle"
/166 = "Farnseber"
/167 = "Tobel"
/168 = "Husten"
</item>

<text aufwaermprime>
/items = aufwaermprimes.items
/select = noreplace
</text>

<item aufwaermprimes.items>
/161 = "Kapuzenpullover"
/162 = "Gedankenkontrolle"
/163 = "Tapetenkleber"
/164 = "Schnittwunde"
/165 = "Abflussreiniger"
/166 = "Röhrenfernseher"
/167 = "Raucherhusten"
/168 = "Bürgerwehr"
</item>

<trial aufwaerm>
/ontrialbegin = [values.trialcounter += 1; values.index = text.aufwaermtarget.nextindex;
      item.aufwaermtargeti.setitem(toupper(item.aufwaermtargeti.item(values.index)), values.index);]
/ontrialend = [values.prime = text.aufwaermprime.currentitem; values.target = text.aufwaermtarget.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, aufwaermprime; 64 = blank, aufwaermtarget]
/validresponse = ("F", "J")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>

(1) Please, in the future, provide code that is complete as to be runnable.
(2) The selection of the target item in your code is dependent on the selection of the prime item.

<text aufwaermtarget>
/items = aufwaermtargeti
/select = current(aufwaermprime)
</text>

Thus you need to take the index of the prime stimulus, the index of the target stimulus is indeterminate as long as no selection of the prime stimulus has occurred.

<trial aufwaerm>
/ontrialbegin = [values.trialcounter += 1; values.index = text.aufwaermprime.nextindex;
      item.aufwaermtargeti.setitem(toupper(item.aufwaermtargeti.item(values.index)), values.index);]
/ontrialend = [values.prime = text.aufwaermprime.currentitem; values.target = text.aufwaermtarget.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, aufwaermprime; 64 = blank, aufwaermtarget]
/validresponse = ("F", "J")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>
By jens - 11/4/2019

Dave - 11/4/2019
jens - 11/4/2019
jens - 11/4/2019
Hello,Thanks a lot for your solution. I tried toupper and .setitem but I failed on setting the proper index. Best wishes Jens

Hello,
I tried out your code and it worked perfectly, however, it does not work in this code. I miss the difference.

<text aufwaermtarget>
/items = aufwaermtargeti
/select = current(aufwaermprime)
</text>

<item aufwaermtargeti>
/161 = "Krimte"
/162 = "Heizung"
/163 = "Klimer"
/164 = "Wunde"
/165 = "Kohle"
/166 = "Farnseber"
/167 = "Tobel"
/168 = "Husten"
</item>

<text aufwaermprime>
/items = aufwaermprimes.items
/select = noreplace
</text>

<item aufwaermprimes.items>
/161 = "Kapuzenpullover"
/162 = "Gedankenkontrolle"
/163 = "Tapetenkleber"
/164 = "Schnittwunde"
/165 = "Abflussreiniger"
/166 = "Röhrenfernseher"
/167 = "Raucherhusten"
/168 = "Bürgerwehr"
</item>

<trial aufwaerm>
/ontrialbegin = [values.trialcounter += 1; values.index = text.aufwaermtarget.nextindex;
      item.aufwaermtargeti.setitem(toupper(item.aufwaermtargeti.item(values.index)), values.index);]
/ontrialend = [values.prime = text.aufwaermprime.currentitem; values.target = text.aufwaermtarget.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, aufwaermprime; 64 = blank, aufwaermtarget]
/validresponse = ("F", "J")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>

(1) Please, in the future, provide code that is complete as to be runnable.
(2) The selection of the target item in your code is dependent on the selection of the prime item.

<text aufwaermtarget>
/items = aufwaermtargeti
/select = current(aufwaermprime)
</text>

Thus you need to take the index of the prime stimulus, the index of the target stimulus is indeterminate as long as no selection of the prime stimulus has occurred.

<trial aufwaerm>
/ontrialbegin = [values.trialcounter += 1; values.index = text.aufwaermprime.nextindex;
      item.aufwaermtargeti.setitem(toupper(item.aufwaermtargeti.item(values.index)), values.index);]
/ontrialend = [values.prime = text.aufwaermprime.currentitem; values.target = text.aufwaermtarget.currentitem;]
/stimulusframes = [1 = fixation; 30 = maske; 61 = blank, aufwaermprime; 64 = blank, aufwaermtarget]
/validresponse = ("F", "J")
/response = timeout (2500)
/branch = [if(values.trialcounter == values.break_after_x) trial.pause]
</trial>

Hello Dave,

okay, next time more code. Thanks a lot for pointing me to the wrong index.

Best wishes Jens