using rshuffle when pulling items from csv file

PennController for IBEX Forums Support using rshuffle when pulling items from csv file

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4264
    cassandra
    Participant

    Hi Jeremy,

    Me again! Almost there with this experiment. I know that “randomize” works in the PennController.Sequence when pulling items from a csv file. However, this seems to show all my items in complete random order which means that more than one test item will be shown in a row, which is not ideal for me. I used to use rshuffle in ibex but it’s not clear to me if this can still be done when items are being drawn from the csv file. I do have items labelled in my spreadsheet but I seem to only be able to specify the column using randomize, not the individual labels within that column.

    Thanks so much!
    -Cassandra

    #4265
    Jeremy
    Keymaster

    Hi Cassandra,

    The labeling and sequence order system did not change in PennController, the only difference is that you no longer have to write var shuffleSequence = seq( ... ), you can use PennController.Sequence( ... ) instead. Items are labeled using the first argument of the PennController function that creates them (if provided as a string). Here’s an example (I use AddTable for the sake of illustration—using a CSV file works just as well):

    PennController.AddTable( "myTable" , `Column1,Column2
    UpperCase,Hello
    LowerCase,hello
    UpperCase,World
    LowerCase,world`
    )
    
    PennController.Sequence( rshuffle("UpperCase","LowerCase") )
    
    PennController.Template( "myTable" ,
      row => PennController( row.Column1 , // Using Column1 to label the trials
          newButton( row.Column2 )
            .print()
            .wait()
      )
    )

    Let me know if the example is unclear

    Jeremy

    #4266
    cassandra
    Participant

    Oh great! Thanks! This helped a lot.

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