NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
Hi there,
I need some help randomly ordering stimuli and questions, separately.
I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed.
How would I accomplish this, without repeating the images or questions?
Thanks!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+xHi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> If you need to present the random pairs repeatedly, you can do something like this: <block myblock> / onblockbegin = [ list.imageorder.setitem(list.nitems.nextindex, 1); list.imageorder.setitem(list.nitems.nextindex, 2); list.imageorder.setitem(list.nitems.nextindex, 3); list.imageorder.setitem(list.nitems.nextindex, 4); list.questionorder.setitem(list.nitems.nextindex, 1); list.questionorder.setitem(list.nitems.nextindex, 2); list.questionorder.setitem(list.nitems.nextindex, 3); list.questionorder.setitem(list.nitems.nextindex, 4); ] / trials = [1-12 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <list nitems> / poolsize = 4 / selectionrate = always </list> <list imageorder> / items = (1,1,1,1) </list> <list questionorder> / items = (1,1,1,1) / selectionmode = list.imageorder.currentindex </list> <text image> / items = imageitems / select = list.imageorder.nextvalue / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = list.questionorder.nextvalue / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item>
|
|
|
NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
+x+x[quote]Hi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> Thank you thank you thank you! So i'm testing this first solution out, but I also have to put in 2 sliders as the response methods. How would I get those 2 sliders in now as well?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+x+x+x[quote]Hi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> Thank you thank you thank you! So i'm testing this first solution out, but I also have to put in 2 sliders as the response methods. How would I get those 2 sliders in now as well? Sorry, that's too vague. Please give me a more concrete description of how exactly you want things to work and look. If you already have some example code from some previous iteration (your initial post suggests you do), please provide that.
|
|
|
NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
+x+x+x+x[quote]Hi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> Thank you thank you thank you! So i'm testing this first solution out, but I also have to put in 2 sliders as the response methods. How would I get those 2 sliders in now as well? Sorry, that's too vague. Please give me a more concrete description of how exactly you want things to work and look. If you already have some example code from some previous iteration (your initial post suggests you do), please provide that. oops, sorry. I took the code you outlined in the first section, and adapted a bit to our pre-existing code. What I believe should happen now (please verify for me) is that there should be 4 surveypages, each with a group (previously referred to as picture) and a game (previously referred to as question) and the pairings should be random for every participant in my activity, and the order will be completely random. This should also let me have 2 sliders appear as the response to the questions from the games. <picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture> <item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item> <picture games> / items = games / select = noreplace / position = (50%, 60%) </picture> <item games> / 1 = "zav_game.png" / 2 = "zorp_game.png" / 3 = "snarf_game.png" / 4 = "meep_game.png" </item> <slider gameq1> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider> <slider gameq2> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider> <surveypage choicequestions1> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions2> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions3> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions4> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions1, choicequestions2, choicequestions3, choicequestions4) ] </block>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+x+x+x+x+x[quote]Hi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> Thank you thank you thank you! So i'm testing this first solution out, but I also have to put in 2 sliders as the response methods. How would I get those 2 sliders in now as well? Sorry, that's too vague. Please give me a more concrete description of how exactly you want things to work and look. If you already have some example code from some previous iteration (your initial post suggests you do), please provide that. oops, sorry. I took the code you outlined in the first section, and adapted a bit to our pre-existing code. What I believe should happen now (please verify for me) is that there should be 4 surveypages, each with a group (previously referred to as picture) and a game (previously referred to as question) and the pairings should be random for every participant in my activity, and the order will be completely random. This should also let me have 2 sliders appear as the response to the questions from the games. <picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture> <item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item> <picture games> / items = games / select = noreplace / position = (50%, 60%) </picture> <item games> / 1 = "zav_game.png" / 2 = "zorp_game.png" / 3 = "snarf_game.png" / 4 = "meep_game.png" </item> <slider gameq1> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider> <slider gameq2> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider> <surveypage choicequestions1> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions2> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions3> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions4> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions1, choicequestions2, choicequestions3, choicequestions4) ] </block> Yes, that should work. (Although I cannot directly test the code because I obviously don't have your stimuli / images; my assessment is solely based on reading through that bit of code.)
|
|
|
NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
+x+x+x+x+x+x[quote]Hi there, I need some help randomly ordering stimuli and questions, separately. I have four images (Image1, Image2, Image3, Image4) and four questions (QuestionA, QuestionB, QuestionC, QuestionD) and I want to randomly pair images to questions in a single block. We typically have the questions in the format of screenshots, but I can change that to text if needed. How would I accomplish this, without repeating the images or questions? Thanks! If you only want to present each random pair a single time, you can simply sample both randomly without replacement. <block myblock> / trials = [1-4 = mytrial] </block> <trial mytrial> / stimulustimes = [0=image, question] / validresponse = (57) </trial> <text image> / items = imageitems / select = noreplace / position = (50%, 30%) </text> <item imageitems> / 1 = "image1.jpg" / 2 = "image2.jpg" / 3 = "image3.jpg" / 4 = "image4.jpg" </item> <text question> / items = questionitems / select = noreplace / position = (50%, 60%) </text> <item questionitems> / 1 = "QuestionA" / 2 = "QuestionB" / 3 = "QuestionC" / 4 = "QuestionD" </item> Thank you thank you thank you! So i'm testing this first solution out, but I also have to put in 2 sliders as the response methods. How would I get those 2 sliders in now as well? Sorry, that's too vague. Please give me a more concrete description of how exactly you want things to work and look. If you already have some example code from some previous iteration (your initial post suggests you do), please provide that. oops, sorry. I took the code you outlined in the first section, and adapted a bit to our pre-existing code. What I believe should happen now (please verify for me) is that there should be 4 surveypages, each with a group (previously referred to as picture) and a game (previously referred to as question) and the pairings should be random for every participant in my activity, and the order will be completely random. This should also let me have 2 sliders appear as the response to the questions from the games. <picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture> <item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item> <picture games> / items = games / select = noreplace / position = (50%, 60%) </picture> <item games> / 1 = "zav_game.png" / 2 = "zorp_game.png" / 3 = "snarf_game.png" / 4 = "meep_game.png" </item> <slider gameq1> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider> <slider gameq2> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider> <surveypage choicequestions1> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions2> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions3> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <surveypage choicequestions4> / stimulustimes = [0=groups, games] / questions = [1=gameq1;2=gameq2] /showpagenumbers = false </surveypage> <block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions1, choicequestions2, choicequestions3, choicequestions4) ] </block> Yes, that should work. (Although I cannot directly test the code because I obviously don't have your stimuli / images; my assessment is solely based on reading through that bit of code.) Thanks a ton Dave!! you have no idea how much time you've saved my team! :)
|
|
|
NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
Oops Dave; need a little more help because there was some problems due to spacing.
So each of the game images I'm fitting in has some questions on the page, and I'm fitting my 2 slider questions right in between so it looks clean and smooth. Because the length of the text and positioning of the questions is a little different, I have to have specifically adjusted slider question locations per text, but I want to keep the same randomization structure. This should work right? I'm thinking if I assigned the specific slider heights to the specific questions, but keep the group images as lists and the order of trials randomized in the Block element, I should be ok? Thank you thank you!!
<picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture>
<item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item>
<picture zav_game> /items = "zav_game.png" </picture>
<picture zorp_game> /items = "zorp_game.png" </picture>
<picture meep_game> /items = "meep_game.png" </picture>
<picture snarf_game> /items = "snarf_game.png" </picture>
<slider gameq1_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider>
<slider gameq2_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider>
<slider gameq1_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 67) </slider>
<slider gameq2_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 87) </slider>
<surveypage choicequestions_zav> / stimulustimes = [0=groups] /stimulusframes = [1=zav_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage>
<<surveypage choicequestions_zorp> / stimulustimes = [0=groups] /stimulusframes = [1=zorp_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage>
<surveypage choicequestions_meep> / stimulustimes = [0=groups] /stimulusframes = [1=meep_game] / questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage>
<surveypage choicequestions_snarf> / stimulustimes = [0=groups] /stimulusframes = [1=snarf_game] / questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage>
<block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions_zav, choicequestions_zorp, choicequestions_snarf, choicequestions_meep) ] </block>
|
|
|
NocteCorvus
|
|
Group: Forum Members
Posts: 8,
Visits: 15
|
Whoops; wrong version of the code. But same conceptual idea, same question.
<picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture>
<item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item>
<picture zav_game> /items = ("zav_game.png") </picture>
<picture zorp_game> /items = ("zorp_game.png") </picture>
<picture meep_game> /items = ("meep_game.png") </picture>
<picture snarf_game> /items = ("snarf_game.png") </picture>
<slider gameq1_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider>
<slider gameq2_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider>
<slider gameq1_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 67) </slider>
<slider gameq2_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 87) </slider>
<surveypage choicequestions_zav> / stimulustimes = [0=groups,zav_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage>
<surveypage choicequestions_zorp> / stimulustimes = [0=groups,zorp_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage>
<surveypage choicequestions_meep> / stimulustimes = [0=groups,meep_game] / questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage>
<surveypage choicequestions_snarf> / stimulustimes = [0=groups,snarf_game] /questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage>
<block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions_zav, choicequestions_zorp, choicequestions_snarf, choicequestions_meep) ] </block>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+xWhoops; wrong version of the code. But same conceptual idea, same question. <picture groups> / items = groups / select = noreplace / position = (50%, 30%) </picture> <item groups> / 1 = "Group 1.png" / 2 = "Group 2.png" / 3 = "Group 3.png" / 4 = "Group 4.png" </item> <picture zav_game> /items = ("zav_game.png") </picture> <picture zorp_game> /items = ("zorp_game.png") </picture> <picture meep_game> /items = ("meep_game.png") </picture> <picture snarf_game> /items = ("snarf_game.png") </picture> <slider gameq1_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 62) </slider> <slider gameq2_high> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 82) </slider> <slider gameq1_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 67) </slider> <slider gameq2_low> / range = (1,5) / defaultresponse = 3 / slidersize = (35, 5) / position = (33, 87) </slider> <surveypage choicequestions_zav> / stimulustimes = [0=groups,zav_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage> <surveypage choicequestions_zorp> / stimulustimes = [0=groups,zorp_game] / questions = [1=gameq1_high;2=gameq2_high] /showpagenumbers = false </surveypage> <surveypage choicequestions_meep> / stimulustimes = [0=groups,meep_game] / questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage> <surveypage choicequestions_snarf> / stimulustimes = [0=groups,snarf_game] /questions = [1=gameq1_low;2=gameq2_low] /showpagenumbers = false </surveypage> <block Activity> / preinstructions = (choice_instruct) /trials = [1-4=random(choicequestions_zav, choicequestions_zorp, choicequestions_snarf, choicequestions_meep) ] </block> If you have to post code that relies on external files (here: images), could you please provide those images? I'm not sure that I'm able to answer questions about positioning, i.e. how things look on the screen, without actually being able to see the actual dimensions of your stimuli. Randomization-wise, however, the code should still do what you want it to do.
|
|
|