Randomizing the order of rating scales appearing on the same page

PennController for IBEX Forums Support Randomizing the order of rating scales appearing on the same page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5025
    elif_cornell
    Participant

    Hi- I am trying set up my trials so that in each trial, an image appears and below the image, there are multiple rating scales. I want to randomize the order of the rating scales. In the code below, I created to scales for two dimensions (active and exciting).

    newTrial(“trial”,
    newImage(“eqlsc001.jpg”)
    .print()
    ,
    newScale(“active_scale”, 7)
    .after( newText(“active_label”, ”  active”) )
    .slider()
    .print()
    ,
    newScale(“exciting_scale”, 7)
    .after( newText(“exciting_label”, ”  exciting”) )
    .slider()
    .print()
    ,
    newSelector()
    .add( getScale(“active_scale”), getScale(“exciting_scale”) )
    .shuffle()
    .log()
    .wait()
    )

    Currently when I run it, the experiment ends after I make a selection using the first scale. What is a way to fix this? Or is there another way to randomize the order or rating scales appearing on the same page?

    Thanks a lot!

    #5026
    Jeremy
    Keymaster

    Hi,

    Your use of the Selector element to shuffle the Scale elements is on the right track, but then calling .wait on that Selector means that you want your participant to simply click on one of the two scales. You should probably replace that .wait() command with .disable() to turn your Selector into a dummy element (you just use it to shuffle the Scales) and add a Validation button at the end where you check that both scales have an option selected, like this:

    newButton("Validate")
      .print()
      .wait( getScale("active_scale").test.selected().and(getScale("exciting_scale").test.selected()) )

    Jeremy

    #5028
    elif_cornell
    Participant

    Thanks a lot! Now I can use the both of the rating scales; however, the order of the scales is not randomized. I think what is happening is that the scales themselves are actually shuffled, but the texts next to the scale (active and exciting) stay the same. I can’t figure out a way to shuffle the scale and its label together. Any ideas on this?

    #5029
    Jeremy
    Keymaster

    Right, sorry, I hadn’t anticipated the Text elements not being randomized along with their respective Scale elements

    The reason why the after and before contents don’t get carried along is because the shuffled elements could actually themselves be in an after/before relationship (as in the example on the documentation page).

    At this point the only solution I see is to create Canvas elements that contain your Scale+Text elements, like this:

    newCanvas("active_scale_container", "auto", "1.5em").print(),
    newScale("active_scale", 7)
        .after( newText("active_label", "  active") )
        .slider()
        .print(0,0,getCanvas("active_scale_container"))
    ,
    newCanvas("exciting_scale_container", "auto" , "1.5em").print(),
    newScale("exciting_scale", 7)
        .after( newText("exciting_label", "  exciting") )
        .slider()
        .print(0,0,getCanvas("exciting_scale_container"))
    ,
    newSelector()
        .add( getCanvas("active_scale_container"), getCanvas("exciting_scale_container") )
        .shuffle()
        .disable()

    Unfortunately you have to specify an arbitrary height, because of the CSS rules that PennController applies to Canvas elements, but 1.5em sounds like a reasonable height.

    Jeremy

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