PennController for IBEX › Forums › Support › randomized set of scales on different pages
- This topic has 2 replies, 2 voices, and was last updated 1 year, 5 months ago by strotter.
-
AuthorPosts
-
June 19, 2023 at 10:15 am #10692strotterParticipant
Hi – I’m trying to implement an experiment which current does not fully work as I’d like. After reading the critical sentence, I would like to show nine questions as scales in a specific manner: I want three scales/questions below each other (see below if it works out after posting) then a button “Next”. Then the same repeats on the second and third page. I would like to randomize the order of the nine scales on the three pages, which is the part that does not work. Is something like this possible?
Thanks for the help!
neutral
low X5 o o o o o o o high X5
low X2 o o o o o o o high X2
low X9 o o o o o o o high X9
[NEXT]June 20, 2023 at 7:48 am #10696JeremyKeymasterHi,
Assuming you are not using
Template
, you can list the question+scale pairs in an array and shuffle it, then successively fetch the elements from the (shuffled) array in three different trials:// array of functions that return a question+scale pair SCALES = [ ()=>[ newText("question1", "Question 1").center().print(), newScale("scale1", 7).before(newText("low X1")).after(newText("high X1")).log().center().print() ], ()=>[ newText("question2", "Question 2").center().print(), newScale("scale2", 7).before(newText("low X2")).after(newText("high X2")).log().center().print() ], ()=>[ newText("question3", "Question 3").center().print(), newScale("scale3", 7).before(newText("low X3")).after(newText("high X3")).log().center().print() ], ()=>[ newText("question4", "Question 4").center().print(), newScale("scale4", 7).before(newText("low X4")).after(newText("high X4")).log().center().print() ], ()=>[ newText("question5", "Question 5").center().print(), newScale("scale1", 7).before(newText("low X5")).after(newText("high X5")).log().center().print() ], ()=>[ newText("question6", "Question 6").center().print(), newScale("scale6", 7).before(newText("low X6")).after(newText("high X6")).log().center().print() ], // etc. ] // shuffle the array fisherYates(SCALES) newTrial( "page1", ...SCALES[0](), // insert the commands returned by the function in the first entry of the array ...SCALES[1](), // insert the commands returned by the function in the second entry of the array ...SCALES[2](), // etc. newButton("Next").center().print().wait() ) newTrial( "page2", ...SCALES[3](), ...SCALES[4](), ...SCALES[5](), newButton("Next").center().print().wait() ) // etc.
Jeremy
June 20, 2023 at 8:41 am #10698strotterParticipantThis looks great! Thanks a lot!
In the current version I do use Template. But I’ll try around, this looks like a good starting point. -
AuthorPosts
- You must be logged in to reply to this topic.