Millisecond Forums

Conditional border around stimuli image

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

By KempInquisit - 11/11/2020

Hi, 
During the test phase, participants will be provided with two images (either on the left side of the screen or right side) and they will have to select on the image they were exposed to during the second study phase. 

After they have made their response, in a subsequent trial I would like a "border" to be presented around the image they did not select. This is because they will be answering a question regarding the image they did not select. Because they are divided up into two separate trials in the block, I am guessing I will need to alter the "/ ontrialbegin =" code for the second trial, based on what was selected in the previous trial. 

Here is what I have so far but the code does not work possibly due to errors with the else if statement:

********TRIAL ONE**********
<trial testcue>
/ inputdevice = mouse
/ stimulusframes = [1 = testcue, statements_test_left, statements_test_right]
/ validresponse = (statements_test_left, statements_test_right)
/ ontrialend = [values.statements_test_left = picture.statements_test_left.currentitem;
                values.statements_test_right = picture.statements_test_right.currentitem;
                if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_left.currentitem;}
                else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_right.currentitem}]
</trial>

<item testcue>
/1 = "Please select the news headline that was presented in phase 2"
</item>

<text testcue>
/ items = testcue
/ position = (50, 70)
/ select = sequence
/ txcolor = (white)
/ txbgcolor = black
/ fontstyle = ("Arial", 3.0%, true, false, false, false, 5, 1)
</text>

<picture statements_test_left>
/ items = ("CoronaBeer_COVID_C.png","Clinton_Nkorea_C.png","Alabama_Senate_M.png","Test_American_Cars_M.png","SKorea_Population_C.png",
"Soccer_Revenue_Gap_M.png","Cali_Fires_C.png","US_Trading_Partner_M.png","Liberian_Women_C.png","Library_AmericanFlag_M.png","Abortion_Bieber_M.png",
"Biden_StudentDebt_C.png","GunControl_Warrant_M.png","Military_Pay_C.png","Immigration_Boy_Cage_C.png","Vaccines_Autism_M.png","Trump_Signed_Legislation_C.png",
"Obama_Website_M.png","Tax_Allocation_C.png","Bernie_Tax_Income_M.png","Brooms_Standing_C.png","Rural_Hospitals_M.png","Chess_Players_C.png","Global_Warming_Antarctica_M.png",
"Black_Homeownership_M.png","SwimmingPool_Deaths_C.png","Veteran_Suicide_M.png","Pope_GunControl_M.png","Amazon_Rainforest_C.png","Bloomberg_Campaign_Money_C.png","Cinderella_Castle_M.png",
"Coffee_C.png","Marriage_License_Benefits_C.png","Cali_Statelaw_M.png","Race_Starbucks_C.png","Murder_Year_M.png","Missing_People_M.png",
"Voter_Turnout_C.png","Gas_2018_M.png","Federal_State_Dollars_C.png","Mexican_Border_Crossings_C.png","Tax_Pres_Law_M.png","Pres_Vacation_C.png",
"UT_Athletes_Ipad_M.png","Rep_Control_C.png")
/ size = (50%, 50%)
/ position = (30, 32)
/ select = sequence(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
                    31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
/ erase = false
</picture>

<picture statements_test_right>
/ items = ("CoronaBeer_COVID_M.png","Clinton_Nkorea_M.png","Alabama_Senate_C.png","Test_American_Cars_C.png","SKorea_Population_M.png","Soccer_Revenue_Gap_C.png",
"Cali_Fires_M.png","US_Trading_Partner_C.png","Liberian_Women_M.png","Library_AmericanFlag_C.png","Abortion_Bieber_C.png","Biden_StudentDebt_M.png",
"GunControl_Warrant_C.png","Military_Pay_M.png","Immigration_Boy_Cage_M.png","Vaccines_Autism_C.png","Trump_Signed_Legislation_M.png","Obama_Website_C.png",
"Tax_Allocation_M.png","Bernie_Tax_Income_C.png","Brooms_Standing_M.png","Rural_Hospitals_C.png","Chess_Players_M.png","Global_Warming_Antarctica_C.png","Black_Homeownership_C.png",
"SwimmingPool_Deaths_M.png","Veteran_Suicide_C.png","Pope_GunControl_C.png","Amazon_Rainforest_M.png","Bloomberg_Campaign_Money_M.png","Cinderella_Castle_C.png",
"Coffee_M.png","Marriage_License_Benefits_M.png","Cali_Statelaw_C.png","Race_Starbucks_M.png","Murder_Year_C.png","Missing_People_C.png","Voter_Turnout_M.png",
"Gas_2018_C.png","Federal_State_Dollars_M.png","Mexican_Border_Crossings_M.png","Tax_Pres_Law_C.png","Pres_Vacation_M.png","UT_Athletes_Ipad_C.png","Rep_Control_M.png",)
/ size = (50%, 50%)
/ position = (70, 32)
/ select = sequence(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
                    31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45)
/ erase = false
</picture>

*****TRIAL TWO*************
<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
       else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]
/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
      else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
      if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
      else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

<item CRQuestion>
/1 = "Is the headline you didn't choose the fake news headline from Phase 1?"
</item>

<text CRQuestion>
/ items = CRQuestion
/ position = (50, 70)
/ select = sequence
/ txcolor = (white)
/ txbgcolor = black
/ fontstyle = ("Arial", 3.0%, true, false, false, false, 5, 1)
</text>z

<text YesCR>
/ items = ("Yes")
/ position = (40%, 80%)
/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = (black)
/ txbgcolor = (white)
/ size = (10%, 5%)
/ vjustify = center
</text>

<text NoCR>
/ items = ("No")
/ position = (60%, 80%)
/ fontstyle = ("Arial", 2%, false, false, false, false, 5, 1)
/ txcolor = (black)
/ txbgcolor = (white)
/ size = (10%, 5%)
/ vjustify = center
</text>

<picture CR_Border_Left>
/ items = ("Border.jpg")
/ size = (55%, 55%)
/ position = (30, 32)
</picture>

<picture CR_Border_Right>
/ items = ("Border.jpg")
/ size = (55%, 55%)
/ position = (70, 32)
</picture>

Thank you for your time. Your help is greatly appreciated.
By KempInquisit - 11/11/2020

Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp
By Dave - 11/12/2020

KempInquisit - 11/12/2020
Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp

I don't even understand what this is supposed to do (apart from it not being valid syntax):

<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
   else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
  else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
  if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
  else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

Please explain your reasoning.
By Dave - 11/12/2020

Dave - 11/12/2020
KempInquisit - 11/12/2020
Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp

I don't even understand what this is supposed to do (apart from it not being valid syntax):

<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
   else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
  else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
  if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
  else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

Please explain your reasoning.

One other note: If you need to share code that requires external files to actually run (here: images), put the script as well as any files it requires to run in a ZIP and attach that ZIP to your post per +Insert -> Add File.


By KempInquisit - 11/12/2020

Dave - 11/12/2020
Dave - 11/12/2020
KempInquisit - 11/12/2020
Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp

I don't even understand what this is supposed to do (apart from it not being valid syntax):

<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
   else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
  else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
  if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
  else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

Please explain your reasoning.

One other note: If you need to share code that requires external files to actually run (here: images), put the script as well as any files it requires to run in a ZIP and attach that ZIP to your post per +Insert -> Add File.



Hi Dave, 
Thanks for the very timely response, you're always super quick! 

To keep it simple, I have slimmed the experiment down to 6 stimuli images per block. Attached to this is the code and relevant stimuli images. 
The idea of the experiment, is that they are shown a news headline statement during the first block of the experiment and they make a belief judgement on that image to keep them occupied (I.e., I am referring to the Block = Belief). This information could be true information or false information. Then later in the next phase (I.e., Block = Correction) they are only shown true information, and thus they have to indicate whether this corrected earlier misinformation (sometimes they could have just seen the true information again and so it wouldn't have corrected earlier false information). Then during the test phase (i.e., Block = Test, Trial = testcue) they are presented with two images, the true headline and the false headline and they have to choose the "correct" statement (I.e., the one they were presented in during Block = Correction). After they have made that response, in the next trial (I.e., makeCRResponse) they have to decide whether the stimuli image they did not select was presented in the first phase (I.e., Block = Belief). Because participants might forget what one they have selected during the testcue trial, I would like a border to be presented around the image they did not select for the makeCRResponse trial. 

My reasoning here for this code below was that if they clicked on the "statements_test_left" (I.e., left image) for their response during the "testcue" trial, a border would then presented on the "statements_test_right" (I.e., right image) when they have to make a decision on the makeCRResponse trial. And vice versa for when they click on the "statements_test_right" (right image) during the "testcue" trial, a border would then presented on the "statements_test_left" (I.e., left image) 

/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
 else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]
By KempInquisit - 11/12/2020

KempInquisit - 11/12/2020
Dave - 11/12/2020
Dave - 11/12/2020
KempInquisit - 11/12/2020
Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp

I don't even understand what this is supposed to do (apart from it not being valid syntax):

<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
   else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
  else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
  if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
  else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

Please explain your reasoning.

One other note: If you need to share code that requires external files to actually run (here: images), put the script as well as any files it requires to run in a ZIP and attach that ZIP to your post per +Insert -> Add File.



Hi Dave, 
Thanks for the very timely response, you're always super quick! 

To keep it simple, I have slimmed the experiment down to 6 stimuli images per block. Attached to this is the code and relevant stimuli images. 
The idea of the experiment, is that they are shown a news headline statement during the first block of the experiment and they make a belief judgement on that image to keep them occupied (I.e., I am referring to the Block = Belief). This information could be true information or false information. Then later in the next phase (I.e., Block = Correction) they are only shown true information, and thus they have to indicate whether this corrected earlier misinformation (sometimes they could have just seen the true information again and so it wouldn't have corrected earlier false information). Then during the test phase (i.e., Block = Test, Trial = testcue) they are presented with two images, the true headline and the false headline and they have to choose the "correct" statement (I.e., the one they were presented in during Block = Correction). After they have made that response, in the next trial (I.e., makeCRResponse) they have to decide whether the stimuli image they did not select was presented in the first phase (I.e., Block = Belief). Because participants might forget what one they have selected during the testcue trial, I would like a border to be presented around the image they did not select for the makeCRResponse trial. 

My reasoning here for this code below was that if they clicked on the "statements_test_left" (I.e., left image) for their response during the "testcue" trial, a border would then presented on the "statements_test_right" (I.e., right image) when they have to make a decision on the makeCRResponse trial. And vice versa for when they click on the "statements_test_right" (right image) during the "testcue" trial, a border would then presented on the "statements_test_left" (I.e., left image) 

/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
 else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

KempInquisit - 11/12/2020
Dave - 11/12/2020
Dave - 11/12/2020
KempInquisit - 11/12/2020
Sorry, this may be helpful too.

<block Test>
/ onblockbegin = [values.testCount = 0; values.testresponse = 1; values.makeTestBeliefs = 1; values.instructnum = 11]
/ trials = [1-45 = sequence (testcue, makeCRResponse)]
</block>

Best,
Kemp

I don't even understand what this is supposed to do (apart from it not being valid syntax):

<trial makeCRResponse>
/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
   else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]

/ inputdevice = mouse
/ stimulusframes = [1 = CRQuestion, NoCR, YesCR, CR_Border_Left, CR_Border_Right]
/ validresponse = (NoCR, YesCR)
/ ontrialend = [if (trial.testcue.response == "statements_test_left") {values.statement = picture.statements_test_right.currentitem;}
  else if (trial.testcue.response == "statements_test_right") {values.statement = picture.statements_test_left.currentitem;}
  if (trial.makeCRResponse.response == "YesCR") {values.makeCRResponse = 1;}
  else if (trial.makeCRResponse.response == "NoCR") {values.makeCRResponse = 0}]
</trial>

Please explain your reasoning.

One other note: If you need to share code that requires external files to actually run (here: images), put the script as well as any files it requires to run in a ZIP and attach that ZIP to your post per +Insert -> Add File.



Hi Dave, 
Thanks for the very timely response, you're always super quick! 

To keep it simple, I have slimmed the experiment down to 6 stimuli images per block. Attached to this is the code and relevant stimuli images. 
The idea of the experiment, is that they are shown a news headline statement during the first block of the experiment and they make a belief judgement on that image to keep them occupied (I.e., I am referring to the Block = Belief). This information could be true information or false information. Then later in the next phase (I.e., Block = Correction) they are only shown true information, and thus they have to indicate whether this corrected earlier misinformation (sometimes they could have just seen the true information again and so it wouldn't have corrected earlier false information). Then during the test phase (i.e., Block = Test, Trial = testcue) they are presented with two images, the true headline and the false headline and they have to choose the "correct" statement (I.e., the one they were presented in during Block = Correction). After they have made that response, in the next trial (I.e., makeCRResponse) they have to decide whether the stimuli image they did not select was presented in the first phase (I.e., Block = Belief). Because participants might forget what one they have selected during the testcue trial, I would like a border to be presented around the image they did not select for the makeCRResponse trial. 

My reasoning here for this code below was that if they clicked on the "statements_test_left" (I.e., left image) for their response during the "testcue" trial, a border would then presented on the "statements_test_right" (I.e., right image) when they have to make a decision on the makeCRResponse trial. And vice versa for when they click on the "statements_test_right" (right image) during the "testcue" trial, a border would then presented on the "statements_test_left" (I.e., left image) 

/ ontrialbegin = [ if (trial.testcue.response = statements_test_left) picture.CR_Border_Right.currentitem;
 else if(trial.testcue.response = statements_test_right) picture.CR_Border_Left.currentitem]
I was unable to upload the images due to "no available space". I apologize for this inconvenience.
By Dave - 11/12/2020

KempInquisit - 11/12/2020

I was unable to upload the images due to "no available space". I apologize for this inconvenience.

I asked you to please put everything in a ZIP and attach that ZIP file. Could you please do that, I cannot work with an incomplete set of files. Could you please do that? If the file is too large to attach it here, email it to me at support <at> millisecond.com. Thanks.
By Dave - 11/12/2020

Dave - 11/12/2020
KempInquisit - 11/12/2020

I was unable to upload the images due to "no available space". I apologize for this inconvenience.

I asked you to please put everything in a ZIP and attach that ZIP file. Could you please do that, I cannot work with an incomplete set of files. Could you please do that? If the file is too large to attach it here, email it to me at support <at> millisecond.com. Thanks.

Thank you for emailing the files. I will respond here for the sake of keeping the thread complete.

Attached you find a revised version of your script and an additional image file that revised version needs. The changes are explained in comments throughout.
By KempInquisit - 11/12/2020

Thanks Dave, this was super helpful!!