Millisecond Forums

Picture items selected by the participant

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

By SilvioM - 1/20/2022

Hello, 
I am trying to create a surveypage in which participants have to select answers among a list of options.
Then, I want to use the selected options as stimuli (pictures) in subsequent trials.
I have followed this tutorial (https://www.millisecond.com/support/docs/v6/html/howto/howtosubjectprovideditems.htm) and tried to copy-paste the code.
However, I was unable to reproduce it and got the error: "The expression contains an unknown property" and "missing close tag" when defining the pictures to be loaded by the script.

Do you have any idea about why I was unable to reproduce the code? Please find attached my script. I am using Inquisit Lab 6.4.1 but I got the same results when using the version 6.5.1 on another computer.

Thank you very much for your help,
Best regards,
Silvio
By Dave - 1/20/2022

SilvioM - 1/20/2022
Hello, 
I am trying to create a surveypage in which participants have to select answers among a list of options.
Then, I want to use the selected options as stimuli (pictures) in subsequent trials.
I have followed this tutorial (https://www.millisecond.com/support/docs/v6/html/howto/howtosubjectprovideditems.htm) and tried to copy-paste the code.
However, I was unable to reproduce it and got the error: "The expression contains an unknown property" and "missing close tag" when defining the pictures to be loaded by the script.

Do you have any idea about why I was unable to reproduce the code? Please find attached my script. I am using Inquisit Lab 6.4.1 but I got the same results when using the version 6.5.1 on another computer.

Thank you very much for your help,
Best regards,
Silvio

(1) </item> is not the proper close tag for a picture element. It ought to be </picture>.



(2) The example in the documentation contains a typo. The property is called "optionvalue" (not "optionvalues"), so it ought to be:

<surveypage page1>
/ questions = [1=cities]
/ ontrialend = [ if (checkboxes.cities.checked.1 == true) item.cities.item = checkboxes.cities.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.cities.checked.2 == true) item.cities.item = checkboxes.cities.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.cities.checked.3 == true) item.cities.item = checkboxes.cities.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.cities.checked.4 == true) item.cities.item = checkboxes.cities.optionvalue.4 ]
/ ontrialend = [ if (checkboxes.cities.checked.5 == true) item.cities.item = checkboxes.cities.optionvalue.5 ]
/ ontrialend = [ if (checkboxes.cities.checked.6 == true) item.cities.item = checkboxes.cities.optionvalue.6 ]
/ ontrialend = [ if (checkboxes.cities.checked.7 == true) item.cities.item = checkboxes.cities.optionvalue.7 ]
</surveypage>

By SilvioM - 1/20/2022

Dave - 1/20/2022
SilvioM - 1/20/2022
Hello, 
I am trying to create a surveypage in which participants have to select answers among a list of options.
Then, I want to use the selected options as stimuli (pictures) in subsequent trials.
I have followed this tutorial (https://www.millisecond.com/support/docs/v6/html/howto/howtosubjectprovideditems.htm) and tried to copy-paste the code.
However, I was unable to reproduce it and got the error: "The expression contains an unknown property" and "missing close tag" when defining the pictures to be loaded by the script.

Do you have any idea about why I was unable to reproduce the code? Please find attached my script. I am using Inquisit Lab 6.4.1 but I got the same results when using the version 6.5.1 on another computer.

Thank you very much for your help,
Best regards,
Silvio

(1) </item> is not the proper close tag for a picture element. It ought to be </picture>.



(2) The example in the documentation contains a typo. The property is called "optionvalue" (not "optionvalues"), so it ought to be:

<surveypage page1>
/ questions = [1=cities]
/ ontrialend = [ if (checkboxes.cities.checked.1 == true) item.cities.item = checkboxes.cities.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.cities.checked.2 == true) item.cities.item = checkboxes.cities.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.cities.checked.3 == true) item.cities.item = checkboxes.cities.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.cities.checked.4 == true) item.cities.item = checkboxes.cities.optionvalue.4 ]
/ ontrialend = [ if (checkboxes.cities.checked.5 == true) item.cities.item = checkboxes.cities.optionvalue.5 ]
/ ontrialend = [ if (checkboxes.cities.checked.6 == true) item.cities.item = checkboxes.cities.optionvalue.6 ]
/ ontrialend = [ if (checkboxes.cities.checked.7 == true) item.cities.item = checkboxes.cities.optionvalue.7 ]
</surveypage>


Thank you so much Dave, it worked!
Best regards,
Silvio
By SilvioM - 1/21/2022

Dear Dave, thanks again for your help.
I have one other question related to the selection of stimuli based on participants' answer. 
Do you think it would be possible to create two lists of stimuli (i.e., PA and PA_red) (with differents items), using a single question/answer? 
I have tried the following code but assigning two "optionvalue" to the same "option" seem to "erase" one of the list.
Thanks again for your amazing support,
Silvio

############################################

<item PA>
</item>

<item PA_red>
</item>

############################################

<checkboxes PA>
/ caption = "Please select three behaviors"
/ options = ("Run", "Swim", "Bike", "Dance")
/ optionvalues = ("Run_Blue.png", "Swim_Blue.png", "Bike_Blue.png", "Dance_Blue.png")
/ optionvalues = ("Run_Red.png", "Swim_Red.png", "Bike_Red.png", "Dance_Red.png")
/ range = (3, 3)
</checkboxes>

<surveypage page1>
/ questions = [1=PA; 2 = PA_red]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA.item = checkboxes.PA.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA.item = checkboxes.PA.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA.item = checkboxes.PA.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA.item = checkboxes.PA.optionvalue.4 ]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA_red.item = checkboxes.PA.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA_red.item = checkboxes.PA.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA_red.item = checkboxes.PA.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA_red.item = checkboxes.PA.optionvalue.4 ]
</surveypage>

<picture selectedPA>
/ items = PA
</picture>

<picture dummy_PA>
/ items = ("Run_Blue.png", "Swim_Blue.png", "Bike_Blue.png", "Dance_Blue.png")
</picture>

<picture selectedPAred>
/ items = PA_red
</picture>

<picture dummy_PA_red>
/ items = ("Run_Red.png", "Swim_Red.png", "Bike_Red.png", "Dance_Red.png")
</picture>

< survey choice_PA >
/ pages = [1=page1]
/ showpagenumbers = false
/ screencolor = white
</survey>
By Dave - 1/21/2022

SilvioM - 1/21/2022
Dear Dave, thanks again for your help.
I have one other question related to the selection of stimuli based on participants' answer. 
Do you think it would be possible to create two lists of stimuli (i.e., PA and PA_red) (with differents items), using a single question/answer? 
I have tried the following code but assigning two "optionvalue" to the same "option" seem to "erase" one of the list.
Thanks again for your amazing support,
Silvio

############################################

<item PA>
</item>

<item PA_red>
</item>

############################################

<checkboxes PA>
/ caption = "Please select three behaviors"
/ options = ("Run", "Swim", "Bike", "Dance")
/ optionvalues = ("Run_Blue.png", "Swim_Blue.png", "Bike_Blue.png", "Dance_Blue.png")
/ optionvalues = ("Run_Red.png", "Swim_Red.png", "Bike_Red.png", "Dance_Red.png")
/ range = (3, 3)
</checkboxes>

<surveypage page1>
/ questions = [1=PA; 2 = PA_red]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA.item = checkboxes.PA.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA.item = checkboxes.PA.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA.item = checkboxes.PA.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA.item = checkboxes.PA.optionvalue.4 ]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA_red.item = checkboxes.PA.optionvalue.1 ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA_red.item = checkboxes.PA.optionvalue.2 ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA_red.item = checkboxes.PA.optionvalue.3 ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA_red.item = checkboxes.PA.optionvalue.4 ]
</surveypage>

<picture selectedPA>
/ items = PA
</picture>

<picture dummy_PA>
/ items = ("Run_Blue.png", "Swim_Blue.png", "Bike_Blue.png", "Dance_Blue.png")
</picture>

<picture selectedPAred>
/ items = PA_red
</picture>

<picture dummy_PA_red>
/ items = ("Run_Red.png", "Swim_Red.png", "Bike_Red.png", "Dance_Red.png")
</picture>

< survey choice_PA >
/ pages = [1=page1]
/ showpagenumbers = false
/ screencolor = white
</survey>

You can't define multiple /optionvalues. How would the program "know" which one you are referring to in any given instance?

What you want is still possible to do, just not in this way. You need to work with item numbers instead.

<item PA>
</item>

<item PA_red>
</item>

############################################

<checkboxes PA>
/ caption = "Please select three behaviors"
/ options = ("Run", "Swim", "Bike", "Dance")
/ range = (3, 3)
</checkboxes>

<surveypage page1>
/ questions = [1=PA;]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA.item = picture.dummy_PA.item(1); ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA.item = picture.dummy_PA.item(2); ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA.item = picture.dummy_PA.item(3); ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA.item = picture.dummy_PA.item(4); ]
/ ontrialend = [ if (checkboxes.PA.checked.1 == true) item.PA_red.item = picture.dummy_PA_red.item(1); ]
/ ontrialend = [ if (checkboxes.PA.checked.2 == true) item.PA_red.item = picture.dummy_PA_red.item(2); ]
/ ontrialend = [ if (checkboxes.PA.checked.3 == true) item.PA_red.item = picture.dummy_PA_red.item(3); ]
/ ontrialend = [ if (checkboxes.PA.checked.4 == true) item.PA_red.item = picture.dummy_PA_red.item(4); ]
</surveypage>

<picture selectedPA>
/ items = PA
</picture>

<picture dummy_PA>
/ items = ("Run_Blue.png", "Swim_Blue.png", "Bike_Blue.png", "Dance_Blue.png")
</picture>

<picture selectedPAred>
/ items = PA_red
</picture>

<picture dummy_PA_red>
/ items = ("Run_Red.png", "Swim_Red.png", "Bike_Red.png", "Dance_Red.png")
</picture>

<survey choice_PA >
/ pages = [1=page1]
/ showpagenumbers = false
/ screencolor = white
</survey>

<block myblock>
/ trials = [1-6 = spablue; 7-12 = spared;]
</block>

<trial spablue>
/ stimulusframes = [1=picture.selectedPA]
/ validresponse = (57)
</trial>

<trial spared>
/ stimulusframes = [1=picture.selectedPAred]
/ validresponse = (57)
</trial>

<expt>
/ blocks = [1=survey.choice_PA; 2=block.myblock]
</expt>

By SilvioM - 1/27/2022


Hello Dave, 
sorry for my late reply, but it worked fine ! Thanks again for your amazing support,
best regards,
Silvio