#1 by TurneyMcK
Hi there, hopefully I can explain this clearly! I'm currently building a DCE. On the 'choice' page I've created, two choice sets are randomly generated and the user is asked to make a binary choice between the two randomly generated options. Our experiment has 7 attributes, each with between 2-4 levels. When a user lands on the choice page, they are presented with two randomly generated combinations of attributes and levels. The randomization component works as intended - i can successfully generate randomized options and display them to the user using a vars_for_template on the choice page. My challenge is with capturing data. I collect the choice as a models.Stringfield() - this works as intended (e.g. choices = models.StringField(label="Which fund would you rather purchase?", choices=[['A', 'A'], ['B', 'B']], widget=widgets.RadioSelectHorizontal)_ However, I need to capture more than the choice - I need to know the makeup of the choicesets they chose between in order to conduct the final analysis (i.e. for attribute 1, i need to know the level that was randomly selected for both the choice set they chose and the choice set they did not choose). In addition to 'choices', i've created a set of other player variables (e.g. attribute1level1 = models.Stringfield()) My problem is that I don't want the user to have to input anything to capture this data - when attribute1level1 is created when the page is run, I want it to be automatically captured within player.attribute1level1. Any ideas as to how to go about doing this? I have included the python file and associated html file here. Thanks!
#3 by TurneyMcK
for added clarity - here's a screenshot of the data page. Ideally i'd like to have the selected levels for each choice set captured
#4 by TurneyMcK
Appreciate anyone who was planning on replying but I have figured it out. Thanks!