Questions tagged [otree]

oTree is a Python framework for multiplayer decision games, behavioral experiments, and surveys

oTree is a Python framework for multiplayer decision games, behavioral experiments, and surveys.

104 questions
3
votes
1 answer

Cannot startproject when installing oTree on Windows 10 ('otree' conflicts with the name of an existing Python module)

I'm trying to reinstall oTree on my Windows 10 computer after some difficulties. I uninstalled oTree and Python, and reinstalled Python and am trying to reinstall oTree, both with the latest available versions (Python 3.6.4, oTree 2.0.18). The…
2
votes
0 answers

Need help re-grouping players in oTree's Python template language after a boolean input:

The idea is that players can select a true or false option and then true selecting players will be divided into random two person live game groups. If and odd number of players select the true option then I would like the random remainder to be…
LWJones
  • 21
  • 2
2
votes
0 answers

Deploy Heroku: when manage.py and settings.py file is in outside of app folder

I have folder map looks like this: `` C:\Users\OS\oTree - oTree | |-- nar2020 (this is the name of my app) | | | |-- templates. | | | |-- _init_.py | | | |-- models.py …
M.Ly
  • 21
  • 2
2
votes
0 answers

Implementing Auto Forwarding to Next Page in OTree

I have a project in OTree in which there is a game with 3 players. They have 120 seconds to decide whether to press a button or not. If within 120 seconds, any player presses the button, the game ends for all 3 players, and they are shown the result…
2
votes
0 answers

Choosing one task out of two in oTree

I have 2 tasks in oTree, both of them consist of radio buttons. Both of the tasks needs to be in the same page, but when the participant will choose to answer one of the forms, I want to disable the other form. In other words, there is 2 forms but…
pnina
  • 149
  • 6
2
votes
0 answers

Connect Otree Project to MySQL

I'm trying to connect my Otree project to MySQL database, but whatever I do it doesn't replace the default database (which is SQLite) with MySQL. When I run the command otree runprodserver 80 and try to access localhost:80 I get the following…
rzarviv
  • 43
  • 4
2
votes
1 answer

How to create a multiple choice question in oTree?

I was wondering if it is possible to have a multiple choice question in otree. Something like radio button but that lets you choose more than one thing. What I'm thinking of is something like: Question: The following list of statements contains…
TEC
  • 53
  • 7
2
votes
1 answer

How to change the size of radiobuttons in otree?

I have a table with various radio buttons in my html code in otree. However, the displayed buttons are super small and hence hard to click on for subjects. Is there a way to increase their size? This is my code so far: {% extends…
TEC
  • 53
  • 7
2
votes
0 answers

NameError for defined class variable

Below, the artifact_urls class variable is clearly defined, and there is no problem referencing it in a print statement or dict constant, but referencing it from within a list comprehension raises a NameError. Why?!?! Here's the code and…
elplatt
  • 3,227
  • 3
  • 18
  • 20
2
votes
2 answers

How to read Python list in Javascript [in a Django template]

I'm programming in oTree (which is a Django based environment for social experiments) and I have the following problem. I defined some lists in Python and I'd like to import them and use them in an HTML template. If I print them in HTML I manage to…
DenisDiderot
  • 57
  • 1
  • 9
2
votes
2 answers

Connect single image to single cell in a table with Javascript

I'm quite new both to programming and to this community, I'll try to be as clear as possible. I need to create an HTML table 16x16 with a button in every cell that displays a different image - a smiley - per cell, without ever showing the same…
DenisDiderot
  • 57
  • 1
  • 9
2
votes
2 answers

How can I turn off the debug mode in oTree?

I'm trying to run a web application from Otree (a web platform based on django and Python) in production mode(debug = false). I can't find where the variable OTREE_PRODUCTION is located.
sotirios
  • 165
  • 1
  • 2
  • 17
1
vote
1 answer

otree: ask a question depending on the answer to a previous question (on the same page)

I would like to incorporate a question in Otree that might or might not be asked depending on a previous question. Here is a very simple example: Question 1: What is your main occupation: A. Work. B. Student. C. Unemployed Question 2 (ONLY ASKED IF…
CAMG
  • 13
  • 3
1
vote
0 answers

Problem with creating a new session Heroku-Otree

I created an experiment with Otree (using Pycharm) and would like to put it on the server Heroku. When I test it on localhost everything works fine. However, on Heroku (otree zip uploaded) when I try to create a session I get this message: Failed to…
1
vote
1 answer

How do you pass a variable from javascript to python (oTree) or django?

I have some created some variables in Javascript to tracker how long an individual holds a button. I would like to pass these variables within a class in python (oTree) to store the data. So, suppose the Javascript code is as follows: let…
1
2 3 4 5 6 7