Presenting Images


Author
Message
Al_Pol
Al_Pol
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)
Group: Forum Members
Posts: 6, Visits: 33
Hello,
I need to create a research form: a photo appears on the page, after 3 seconds it disappears, after which a question automatically appears. After the person answers the question (chooses an answer option), the next photo is automatically displayed for 3 seconds, then another question follows, and so on.
Please tell me how I could bring my idea to life.
I can't figure out how to use the photo in the script. Does it need to be uploaded to some platform or can it just stay on my computer?
I would appreciate any hints.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Al_Pol - 2/15/2023
Hello,
I need to create a research form: a photo appears on the page, after 3 seconds it disappears, after which a question automatically appears. After the person answers the question (chooses an answer option), the next photo is automatically displayed for 3 seconds, then another question follows, and so on.
Please tell me how I could bring my idea to life.
I can't figure out how to use the photo in the script. Does it need to be uploaded to some platform or can it just stay on my computer?
I would appreciate any hints.

Please start by working through the programmer's manual:

https://www.millisecond.com/support/Inquisit%20Programmer's%20Manual.pdf

Once you've familiarized yourself with the basics of the language, we can discuss further.

As for uploading images, if you ultimately want to collect data via the web, then yes, you will need to upload images and any other files your experiment may need. If not, the files can remain on your computer only.
Al_Pol
Al_Pol
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)
Group: Forum Members
Posts: 6, Visits: 33
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Al_Pol
Al_Pol
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)
Group: Forum Members
Posts: 6, Visits: 33
Dave - 2/16/2023
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Thanks a lot for your help! But when loading this script, I have 2 problems:
1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)
2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Al_Pol - 2/20/2023
Dave - 2/16/2023
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Thanks a lot for your help! But when loading this script, I have 2 problems:
1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)
2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

> 1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)

As noted in the comments:

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

So, change this to a <picture> element.

> 2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

Define three text elements -- one for option a, one for b, one for c -- and have the trial display them on-screen. Set the trial's /inputdevice to mouse and define the three text elements as the response options in the trial's /validresponse.

<text sad>
/ items = ("a) sad")
/ position = (30%, 80%)
</text>

<text neutral>
/ items = ("b) neutral")
/ position = (50%, 80%)
</text>

<text happy>
/ items = ("c) happy")
/ position = (70%, 80%)
</text>

...

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1, text.sad, text.neutral, text.happy]
/ validresponse = (sad, neutral, happy)
/ inputdevice = mouse
</trial>




Edited Last Year by Dave
Al_Pol
Al_Pol
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)
Group: Forum Members
Posts: 6, Visits: 33
Dave - 2/20/2023
Al_Pol - 2/20/2023
Dave - 2/16/2023
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Thanks a lot for your help! But when loading this script, I have 2 problems:
1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)
2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

> 1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)

As noted in the comments:

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

So, change this to a <picture> element.

> 2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

Define three text elements -- one for option a, one for b, one for c -- and have the trial display them on-screen. Set the trial's /inputdevice to mouse and define the three text elements as the response options in the trial's /validresponse.

<text sad>
/ items = ("a) sad")
/ position = (30%, 80%)
</text>

<text neutral>
/ items = ("b) neutral")
/ position = (50%, 80%)
</text>

<text happy>
/ items = ("c) happy")
/ position = (70%, 80%)
</text>

...

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1, text.sad, text.neutral, text.happy]
/ validresponse = (sad, neutral, happy)
/ inputdevice = mouse
</trial>




Thanks, all worked well; ) and if I wanted arrange the order (myself) of the presented photos (so that each participant sees the same order), but for the program to randomly assign questions to these photos, where in the script would I have to make changes? while the program presents photos in random order for each participants (each trial is a new photo order)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Al_Pol - 2/20/2023
Dave - 2/20/2023
Al_Pol - 2/20/2023
Dave - 2/16/2023
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Thanks a lot for your help! But when loading this script, I have 2 problems:
1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)
2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

> 1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)

As noted in the comments:

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

So, change this to a <picture> element.

> 2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

Define three text elements -- one for option a, one for b, one for c -- and have the trial display them on-screen. Set the trial's /inputdevice to mouse and define the three text elements as the response options in the trial's /validresponse.

<text sad>
/ items = ("a) sad")
/ position = (30%, 80%)
</text>

<text neutral>
/ items = ("b) neutral")
/ position = (50%, 80%)
</text>

<text happy>
/ items = ("c) happy")
/ position = (70%, 80%)
</text>

...

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1, text.sad, text.neutral, text.happy]
/ validresponse = (sad, neutral, happy)
/ inputdevice = mouse
</trial>




Thanks, all worked well; ) and if I wanted arrange the order (myself) of the presented photos (so that each participant sees the same order), but for the program to randomly assign questions to these photos, where in the script would I have to make changes? while the program presents photos in random order for each participants (each trial is a new photo order)

You specify the order you want in the list elements and set them to sequential selection.
Al_Pol
Al_Pol
Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)Associate Member (66 reputation)
Group: Forum Members
Posts: 6, Visits: 33
Dave - 2/20/2023
Al_Pol - 2/20/2023
Dave - 2/20/2023
Al_Pol - 2/20/2023
Dave - 2/16/2023
Al_Pol - 2/16/2023
I have read the study material. I understood how to add images and adjust their parameters. But I can’t figure out how to make the photos alternate with questions. In my research, I need to present participants with 60 photos and 2 questions for each photo:
photo number 1 (disappears after 3 seconds) --> question number 1 (choose an answer)
photo number 2 (3 sec) --> question number 2 (likert scale)
photo 3 --> question 2
photo 4--> question 1
photo 1 again --> but with question number 2
etc etc etc.
but it should not be a completely random and different sequence of images and photos for each participant. The sequence must be pseudo-random. That is, I mix questions and photos on my own (so that it doesn’t happen that after photo number 1 and question number 1, the first photo is not presented again and just with question 2) and each participant sees only such a sequence.

I hope I didn't confuse you.

<values>
/ imageitemnumber = 1
/ questionnumber = 0
</values>

// each image item number is present twice
// sampling is random without replacement
// maxrunsize is set to 1, i.e. the same item number may not occur twice in a row (i.e. no such thing as 5->5)
<list imagelist>
/ items = (1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
/ selectionmode = random
/ replace = false
/ maxrunsize = 1
</list>

// paired to imagelist. Each image is to be presented once with question 1 and once with question 2
<list questionlist>
/ items = (1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2)
/ selectionmode = list.imagelist.currentindex
</list>

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

<item imageitems>
/ 1 = "img01.jpg"
/ 2 = "img02.jpg"
/ 3 = "img03.jpg"
/ 4 = "img04.jpg"
/ 5 = "img05.jpg"
/ 6 = "img06.jpg"
/ 7 = "img07.jpg"
/ 8 = "img08.jpg"
/ 9 = "img09.jpg"
/ 10 = "img10.jpg"
</item>

<text question1>
/ items = ("Question 1 (press E or I)")
</text>

<text question2>
/ items = ("Question 2 (select a rating)")
</text>


// selects an image item from the list
// and the question type (1 or 2)
<trial selectiontrial>
/ ontrialbegin = [
    values.imageitemnumber = list.imagelist.nextvalue;
    values.questionnumber = list.questionlist.nextvalue;
]
/ validresponse = (0)
/ trialduration = 0
/ recorddata = false
// invoke either q1 or q2 trial
/ branch = [
    if (values.questionnumber == 1) {
        return trial.q1;
    } else if (values.questionnumber == 2) {
        return likert.q2;
    }
]
</trial>

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1]
/ validresponse = ("e", "i")
</trial>

// presents image for 3 seconds, clears screen, displays Q2 and collects response
<likert q2>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question2]
/ anchors = [1="cool"; 5="hot"]
/ numpoints = 5
/ position = (50%, 70%)
</likert>

<block exanpleblock>
/ trials = [1-20 = trial.selectiontrial]
</block>

Thanks a lot for your help! But when loading this script, I have 2 problems:
1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)
2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

> 1. Photos are not uploaded, instead of them just a text file name. There is definitely no error with the files themselves (they are loaded without problems in another script)

As noted in the comments:

// ought to be a picture element in the actual script
<text image>
/ items = imageitems
/ select = values.imageitemnumber
</text>

So, change this to a <picture> element.

> 2. I would like question 1 to be a test question, but I don't understand how to change it so that no errors occur. For example: what is the emotion on this man's face? and 3 answer options: a) neutral, b) sadness, c) fear

Define three text elements -- one for option a, one for b, one for c -- and have the trial display them on-screen. Set the trial's /inputdevice to mouse and define the three text elements as the response options in the trial's /validresponse.

<text sad>
/ items = ("a) sad")
/ position = (30%, 80%)
</text>

<text neutral>
/ items = ("b) neutral")
/ position = (50%, 80%)
</text>

<text happy>
/ items = ("c) happy")
/ position = (70%, 80%)
</text>

...

// presents image for 3 seconds, clears screen, displays Q1 and collects response
<trial q1>
/ stimulustimes = [0=text.image; 3000=clearscreen, text.question1, text.sad, text.neutral, text.happy]
/ validresponse = (sad, neutral, happy)
/ inputdevice = mouse
</trial>




Thanks, all worked well; ) and if I wanted arrange the order (myself) of the presented photos (so that each participant sees the same order), but for the program to randomly assign questions to these photos, where in the script would I have to make changes? while the program presents photos in random order for each participants (each trial is a new photo order)

You specify the order you want in the list elements and set them to sequential selection.

Previously, errors arose when I tried to do this, but everything turned out as I wanted.   Thanks a lot for your help!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search