oTree Forum >

Randomize App

#1 by FEDx

Hello everyone,
I would like to reopen this topic that seems to me to be important considering also the policies of several journals. 

I have three session configs. Let's say:
1= A, B, C, D, E, F
2= A, B, C, D, G, H
3= A, B, C, D, L, M

I would like to randomize B, C, and D, which always come after A and are the same for all configurations.

What is the best way without going into oTree's code?

#2 by ccrabbe

Hi FEDx -

I have used the method Philipp uses here:  https://github.com/chapkovski/randomizing-apps-otree  to randomize apps in the way you want.  You can copy his methodology and instead of 

first_app, *tail = app_seq

you can do

first_app, *middle, second_last, last = app_seq

and then randomize middle and reassemble.


#3 by Juanfran

Hello Chris,

Did you use Philipp's method to randomize apps with the new version of otree (>5) or with the older one? I was wondering how to use that method in the new otree since I didn't manage to transform it. My main issues were regarding how to transform the sequence_of_apps (something that was done in the models.py file of the first app, but that in the new otree version I couldn't do it since it doesn't allow to modify it) and how to pass the updated_seq_apps from one app to another (something that was read in the previous pages.py file, but that in the new otree version I couldn't do it).



Write a reply

Set forum username