Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Running Experiment Intermittently

S_HS_H Posts: 20

Dear OpenSesame comuunity,

I have an experimental challenge and I'll be thankful for your help.

I have a memory task that I am running in 2 sessions, each one in different day.

I have one words list of 100 words, which I would like to split randomly for each participant to the two sessions.

That is, to present 50 words in each session, while every participant sees different list in every session. Overall, all the participants will see all the 100 words.

I hope I'm clear enough,

Do anyone have any idea what code or loops i need to create?

I'll be grateful for any idea.

Comments

  • JarikJarik Posts: 170

    Hi S_H,

    You will have to do some programming. Below is proof-of-concept example with a list 6 instead of 100 items. It saves the second part of the list that you could use for the second session.

    from random import shuffle
    
    t6 = '[1,2,3,4,5,6]'
    print t6
    
    # You will have to use eval() to change the string into a list!
    t6list = eval(t6)
    shuffle(t6list)
    print t6list
    
    t6listFirst = t6list[:3]
    print t6listFirst
    
    t6listSecond = t6list[3:]
    print t6listSecond 
    
    
    FullPath = var.experiment_path + '\\t6listSecond_' + str(var.subject_nr) + '.txt'
    print FullPath 
    
    file = open(FullPath, "w")
    
    # You will have to use str() to change the list into a string!
    file.write(str(t6listSecond))
    
    file.close()
    

    Best,
    Jarik

  • S_HS_H Posts: 20

    This is exactly what I looked for, Thank you so much!!

Sign In or Register to comment.