Millisecond Forums

using stimuli position

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

By anisa_khalfan - 3/31/2021

Hi,

I have what I hope is a quick question.

So I have this current script:

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

And I want to add another face, male_happy, to the trial but I want it to be at the same x position as the text happy on every trial. How would I do this? Any links or suggestions would be appreciated.

Anisa Khalfan
By Dave - 3/31/2021

anisa_khalfan - 3/31/2021
Hi,

I have what I hope is a quick question.

So I have this current script:

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

And I want to add another face, male_happy, to the trial but I want it to be at the same x position as the text happy on every trial. How would I do this? Any links or suggestions would be appreciated.

Anisa Khalfan

Then you ought so select the position for the "happy" text element first and then set the picture's x position to that of the text.

<trial H_happy>
/ ontrialbegin = [
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue;
    picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>
By anisa_khalfan - 3/31/2021

Dave - 3/31/2021
anisa_khalfan - 3/31/2021
Hi,

I have what I hope is a quick question.

So I have this current script:

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

And I want to add another face, male_happy, to the trial but I want it to be at the same x position as the text happy on every trial. How would I do this? Any links or suggestions would be appreciated.

Anisa Khalfan

Then you ought so select the position for the "happy" text element first and then set the picture's x position to that of the text.

<trial H_happy>
/ ontrialbegin = [
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue;
    picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

Oh yes thank you!

One follow up question, if I want to add an X on top of the trial if they answer incorrectly I add a branch to another trial. I have done this in the past but for some reason when I implement it now, it uses a different face (male_happy) for the error page.

Here is a sample trial:
<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
/ branch = [
    if (trial.H_happy.error) trial.error_H_happy
]
</trial>

<trial error_H_happy>
/ stimulusframes = [1=male_happy, happy, error]
/ trialduration = 600
</trial>

Any idea why this is happening? I attached the script for reference.
By Dave - 4/1/2021

anisa_khalfan - 4/1/2021
Dave - 3/31/2021
anisa_khalfan - 3/31/2021
Hi,

I have what I hope is a quick question.

So I have this current script:

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

And I want to add another face, male_happy, to the trial but I want it to be at the same x position as the text happy on every trial. How would I do this? Any links or suggestions would be appreciated.

Anisa Khalfan

Then you ought so select the position for the "happy" text element first and then set the picture's x position to that of the text.

<trial H_happy>
/ ontrialbegin = [
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue;
    picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
</trial>

Oh yes thank you!

One follow up question, if I want to add an X on top of the trial if they answer incorrectly I add a branch to another trial. I have done this in the past but for some reason when I implement it now, it uses a different face (male_happy) for the error page.

Here is a sample trial:
<trial H_happy>
/ ontrialbegin = [picture.male_happy.hposition=counter.hpositions.selectedvalue;
  text.happy.hposition=counter.hpositions.selectedvalue;
    text.happy.vposition=counter.vpositions.selectedvalue]
/ stimulusframes = [1=male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
/ branch = [
    if (trial.H_happy.error) trial.error_H_happy
]
</trial>

<trial error_H_happy>
/ stimulusframes = [1=male_happy, happy, error]
/ trialduration = 600
</trial>

Any idea why this is happening? I attached the script for reference.

A selection on the picture occurs every time you display it, that's exactly what is supposed to happen.

And you don't need another trial, you simply need /errormessage in <trial H_happy>.

https://www.millisecond.com/support/docs/v5/html/language/attributes/errormessage.htm

By anisa_khalfan - 4/1/2021

In another post I read that error message does not allow you display multiple stimuli and that the best solution was to use another trial. Is that not true?

I need to display male_happy, happy, and error at the same time if they answer incorrectly.
By Dave - 4/1/2021

The trial here already displays the other stimuli (the word and the image), so this is not relevant. What you are referring to was an entirely different situation.

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
/ erase = false
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
/ erase = false
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [
text.happy.hposition=counter.hpositions.selectedvalue;
  text.happy.vposition=counter.vpositions.selectedvalue;
  picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=clearscreen, male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
/ errormessage = true(error, 600)
</trial>

<text error>
/ items = ("X")
/ fontstyle = ("Arial", 200pt, true)
/ position = (50%,50%)
/ txbgcolor = transparent
/ txcolor = black
</text>

By anisa_khalfan - 4/1/2021

Dave - 4/1/2021
The trial here already displays the other stimuli (the word and the image), so this is not relevant. What you are referring to was an entirely different situation.

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
/ erase = false
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
/ erase = false
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [
text.happy.hposition=counter.hpositions.selectedvalue;
  text.happy.vposition=counter.vpositions.selectedvalue;
  picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=clearscreen, male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
/ errormessage = true(error, 600)
</trial>

<text error>
/ items = ("X")
/ fontstyle = ("Arial", 200pt, true)
/ position = (50%,50%)
/ txbgcolor = transparent
/ txcolor = black
</text>


This makes a lot of sense, and will save me a ton of time. Thank you
By anisa_khalfan - 4/1/2021


Dave - 4/1/2021
The trial here already displays the other stimuli (the word and the image), so this is not relevant. What you are referring to was an entirely different situation.

<item male_happy>
/1 = "057_y_m_h_b.jpg"
</item>

<picture male_happy>
/ items = male_happy
/ position = (25%,50%)
/ size = (30%,30%)
/ erase = false
</picture>

<item happy>
/1 = "happy"
</item>

<text happy>
/ items = happy
/ fontstyle = ("Arial", 50pt, true)
/ position = (25%,50%)
/ erase = false
</text>

<counter hpositions>
/ items = (25%, 75%)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vpositions>
/ items = (25%,75%)
/ select = noreplace
/ selectionrate = always
</counter>

<trial H_happy>
/ ontrialbegin = [
text.happy.hposition=counter.hpositions.selectedvalue;
  text.happy.vposition=counter.vpositions.selectedvalue;
  picture.male_happy.hposition=text.happy.hposition;]
/ stimulusframes = [1=clearscreen, male_happy, happy]
/ validresponse = (203,205)
/ correctresponse = (205)
/ errormessage = true(error, 600)
</trial>

<text error>
/ items = ("X")
/ fontstyle = ("Arial", 200pt, true)
/ position = (50%,50%)
/ txbgcolor = transparent
/ txcolor = black
</text>


I just fixed my script but this keeps the stimuli on for all the trials. Is there a way to erase it once the trial is over?
Otherwise the previous trials stimulus remains on the screen during the next trial.