sepWithN function reverses item order

PennController for IBEX Forums Support sepWithN function reverses item order

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6443
    Yanru
    Participant

    Hi Jeremy,

    I’m using the function sepWithN in my sequence to add breaks in my experiment. It works well except that I realized that the items are displayed in a reversed order as in my list in the csv file. As I need the items to display in a certain order, the items are pseudo-randomized manually and not by using the randomize/rshuffle function.
    Is there any way to solve this except for reversing the list manually?

    Thanks a lot in advance!

    Best,
    Yanru

    #6444
    Jeremy
    Keymaster

    Hi Yanru,

    Try replacing this line from the definition of SepWith:

    newArray.push(main.pop());

    with this instead:

    newArray.push(main.shift());

    Let me know whether that worked for you

    Jeremy

    #6447
    Yanru
    Participant

    Hi Jeremy,

    yes, it works perfectly! Thanks a lot!

    Yanru

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