oTree Forum >

Help with App and role randomization

#1 by oscarmdiazb (edited )

Hi, 

I have developed a set of six cooperative games intended for use in classroom settings. Each game involves students being paired randomly and assigned one of two distinct roles.

I would like to implement the following features for each classroom session:
    1.    Random pairing and role assignment: Each time an app is launched, student pairings and role assignments should be randomized anew. That is, a student paired with Player F in App 1 should be randomly reassigned in App 2.
    2.    Randomized app order: The sequence in which the six apps are presented should vary across classrooms (sessions). For example, Classroom 1 should see a different game order than Classroom 2.

I haven't been able to implement these fixes in Otree studio. Any leeds?

Thanks a lot!

#2 by ccrabbe

Hi oscarmdiazb -    

For (2), there's no built-in way to randomize app order in oTree.  Since you're in a classroom setting, you can "pre-randomize" the app order by creating different SESSION_CONFIG entries with different pre-randomized APP_SEQUENCE orders, and then using a different one for each classroom.  This is probably the simplest way.  If you genuinely need to randomize on the fly, you can use a more involved solution like: https://github.com/chapkovski/randomizing-apps-otree

For (1), you can randomize the pairings by calling group_randomly() in creating_session of each app (this is executed when you create the session).  If you require that a player will be matched with a *different* player from the previous app, then you'll need to do that yourself.  You can randomize your roles in creating_session of each app as well.

Thanks,
--Chris

Write a reply

Set forum username