oTree Forum >

Using globals in Otree

#1 by martin

Hi, I want to create a list of all submitted answers for a player. I can run the following code in python, but cannot in Otree:

#players' data (inputed for this example. these would be recorded responses in a survey)
p1_q1=8
p1_q2=4

#get players answers
p1_answers= [globals()['p1_q%s' % q] for q in range(1,3)]

Write a reply

Set forum username