randomized set of scales on different pages

PennController for IBEX Forums Support randomized set of scales on different pages

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10692
    strotter
    Participant

    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]

    #10696
    Jeremy
    Keymaster

    Hi,

    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

    #10698
    strotter
    Participant

    This 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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.