Multiple choices as Field

135 views
Skip to first unread message

joya.zh...@gmail.com

unread,
Aug 24, 2021, 11:30:22 PM8/24/21
to oTree help & discussion
Hi, 

Is there a way to create a field that allows for multiple choices? I would like subjects to choose three intergers from [0,14], and the selected intergers will be used in later functions. I have tried below under class Group(BaseGroup):
tool_models.MultipleChoiceModelField(label="Please select three intergers below",
min_choices=3, max_choices=3)

Is this the right way to do this? Can I treat the output as a list? Thanks very much!

Chris @ oTree

unread,
Aug 25, 2021, 4:40:03 AM8/25/21
to joya.zh...@gmail.com, oTree help & discussion
See the multi_select example here: https://www.otreehub.com/projects/otree-snippets/

Sent from my phone

On Aug 24, 2021, at 9:30 PM, joya.zh...@gmail.com <joya.zh...@gmail.com> wrote:

Hi, 
--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/508c5385-52d5-4ba9-911e-24286534aa54n%40googlegroups.com.

joya.zh...@gmail.com

unread,
Aug 25, 2021, 10:56:14 AM8/25/21
to oTree help & discussion
Thanks very much!
Reply all
Reply to author
Forward
0 new messages